From 6548a20b9cfa9f1b934f8d1eacbddb2db20c9e5b Mon Sep 17 00:00:00 2001 From: thewrlck Date: Thu, 6 Jun 2024 09:08:36 +0200 Subject: [PATCH 1/3] add txdata to block json response to sync easier outside rust --- src/api.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api.rs b/src/api.rs index 5578094916..3290d73274 100644 --- a/src/api.rs +++ b/src/api.rs @@ -6,8 +6,7 @@ use { pub use crate::{ subcommand::decode::RawOutput as Decode, templates::{ - BlocksHtml as Blocks, RuneHtml as Rune, RunesHtml as Runes, StatusHtml as Status, - TransactionHtml as Transaction, + BlocksHtml as Blocks, RuneHtml as Rune, RunesHtml as Runes, StatusHtml as Status }, }; @@ -19,6 +18,7 @@ pub struct Block { pub inscriptions: Vec, pub runes: Vec, pub target: BlockHash, + pub txdata: Vec } impl Block { @@ -36,6 +36,7 @@ impl Block { best_height: best_height.0, inscriptions, runes, + txdata: block.txdata, } } } From 6dbce159a4a6c557ec3fb59ff859bffd804448d8 Mon Sep 17 00:00:00 2001 From: thewrlck Date: Fri, 7 Jun 2024 11:01:54 +0200 Subject: [PATCH 2/3] use exported type from imports --- src/api.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api.rs b/src/api.rs index 3290d73274..bf81fd3a77 100644 --- a/src/api.rs +++ b/src/api.rs @@ -1,12 +1,14 @@ use { super::*, serde_hex::{SerHex, Strict}, + bitcoin::blockdata::transaction::Transaction as Txdata }; pub use crate::{ subcommand::decode::RawOutput as Decode, templates::{ - BlocksHtml as Blocks, RuneHtml as Rune, RunesHtml as Runes, StatusHtml as Status + BlocksHtml as Blocks, RuneHtml as Rune, RunesHtml as Runes, StatusHtml as Status, + TransactionHtml as Transaction, }, }; @@ -18,7 +20,7 @@ pub struct Block { pub inscriptions: Vec, pub runes: Vec, pub target: BlockHash, - pub txdata: Vec + pub txdata: Vec, } impl Block { From 1c61646d50c837a5c41693cda3fb2e0ae168af4c Mon Sep 17 00:00:00 2001 From: raphjaph Date: Sun, 9 Jun 2024 00:07:38 +0200 Subject: [PATCH 3/3] Rename to transactions --- src/api.rs | 5 ++--- tests/json_api.rs | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api.rs b/src/api.rs index bf81fd3a77..45200115e6 100644 --- a/src/api.rs +++ b/src/api.rs @@ -1,7 +1,6 @@ use { super::*, serde_hex::{SerHex, Strict}, - bitcoin::blockdata::transaction::Transaction as Txdata }; pub use crate::{ @@ -20,7 +19,7 @@ pub struct Block { pub inscriptions: Vec, pub runes: Vec, pub target: BlockHash, - pub txdata: Vec, + pub transactions: Vec, } impl Block { @@ -38,7 +37,7 @@ impl Block { best_height: best_height.0, inscriptions, runes, - txdata: block.txdata, + transactions: block.txdata, } } } diff --git a/tests/json_api.rs b/tests/json_api.rs index 5cc7afa88b..1f209de852 100644 --- a/tests/json_api.rs +++ b/tests/json_api.rs @@ -396,6 +396,7 @@ fn get_block() { height: 0, inscriptions: Vec::new(), runes: Vec::new(), + transactions: block_json.transactions.clone(), } ); }