Page MenuHomePhabricator

D13850.id.diff
No OneTemporary

D13850.id.diff

diff --git a/chronik/chronik-bridge/src/ffi.rs b/chronik/chronik-bridge/src/ffi.rs
--- a/chronik/chronik-bridge/src/ffi.rs
+++ b/chronik/chronik-bridge/src/ffi.rs
@@ -52,6 +52,8 @@
pub data_pos: u32,
/// Position of the undo data within the undo file.
pub undo_pos: u32,
+ /// Serialized size of the block
+ pub size: u64,
/// Txs of this block, including positions within the block/undo files.
pub txs: Vec<BlockTx>,
}
diff --git a/chronik/chronik-cpp/chronik_bridge.cpp b/chronik/chronik-cpp/chronik_bridge.cpp
--- a/chronik/chronik-cpp/chronik_bridge.cpp
+++ b/chronik/chronik-cpp/chronik_bridge.cpp
@@ -149,6 +149,7 @@
.file_num = uint32_t(bindex.nFile),
.data_pos = bindex.nDataPos,
.undo_pos = bindex.nUndoPos,
+ .size = bindex.nSize,
.txs = bridged_txs};
}
diff --git a/chronik/test/bridgeprimitives_tests.cpp b/chronik/test/bridgeprimitives_tests.cpp
--- a/chronik/test/bridgeprimitives_tests.cpp
+++ b/chronik/test/bridgeprimitives_tests.cpp
@@ -64,6 +64,7 @@
BOOST_CHECK_EQUAL(left.file_num, right.file_num);
BOOST_CHECK_EQUAL(left.data_pos, right.data_pos);
BOOST_CHECK_EQUAL(left.undo_pos, right.undo_pos);
+ BOOST_CHECK_EQUAL(left.size, right.size);
BOOST_CHECK_EQUAL(left.txs.size(), right.txs.size());
for (size_t txIdx = 0; txIdx < left.txs.size(); ++txIdx) {
@@ -144,6 +145,7 @@
.file_num = 0,
.data_pos = 8, // 8 magic bytes in block file
.undo_pos = 0, // genesis has no undo data
+ .size = 285,
.txs = {{
.tx = expectedGenesisTx,
.data_pos = 89, // +80 header +1 compact size
@@ -296,6 +298,7 @@
.file_num = 0,
.data_pos = 39948,
.undo_pos = 8249,
+ .size = 578,
.txs = {
{.tx = expectedTestTx0, .data_pos = 40029, .undo_pos = 0},
{.tx = expectedTestTx1, .data_pos = 40129, .undo_pos = 8250},

File Metadata

Mime Type
text/plain
Expires
Tue, May 20, 22:13 (18 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5866034
Default Alt Text
D13850.id.diff (1 KB)

Event Timeline