Skip to content

Commit 5df77d7

Browse files
author
Ludo Galabru
committed
feat: improve debug log
1 parent 0978a5d commit 5df77d7

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

components/chainhook-sdk/src/hord/db/mod.rs

+11-8
Original file line numberDiff line numberDiff line change
@@ -938,14 +938,6 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
938938
>,
939939
ctx: &Context,
940940
) -> Result<TraversalResult, String> {
941-
ctx.try_log(|logger| {
942-
slog::info!(
943-
logger,
944-
"Computing ordinal number for Satoshi point {}:0:0 (block #{})",
945-
transaction_identifier.hash,
946-
block_identifier.index
947-
)
948-
});
949941
let mut inscription_offset_intra_output = 0;
950942
let mut inscription_output_index: usize = 0;
951943
let mut ordinal_offset = 0;
@@ -984,6 +976,17 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
984976
inscription_offset_intra_output = inscription_offset_cross_outputs - min;
985977
}
986978
}
979+
ctx.try_log(|logger| {
980+
slog::info!(
981+
logger,
982+
"Computing ordinal number for Satoshi point {} ({}:0 -> {}:{}) (block #{})",
983+
transaction_identifier.hash,
984+
input_index,
985+
inscription_output_index,
986+
inscription_offset_intra_output,
987+
block_identifier.index
988+
)
989+
});
987990

988991
let mut tx_cursor: ([u8; 8], usize) = (txid, input_index);
989992
let mut hops: u32 = 0;

components/chainhook-sdk/src/indexer/tests/helpers/bitcoin_blocks.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ pub fn generate_test_bitcoin_block(
4343
parent_block_identifier,
4444
timestamp: 0,
4545
transactions,
46-
metadata: BitcoinBlockMetadata {},
46+
metadata: BitcoinBlockMetadata {
47+
network: chainhook_types::BitcoinNetwork::Regtest,
48+
},
4749
}
4850
}
4951

0 commit comments

Comments
 (0)