Skip to content

Commit

Permalink
feat: improve debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludo Galabru committed Jun 13, 2023
1 parent 0978a5d commit 5df77d7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
19 changes: 11 additions & 8 deletions components/chainhook-sdk/src/hord/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -938,14 +938,6 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
>,
ctx: &Context,
) -> Result<TraversalResult, String> {
ctx.try_log(|logger| {
slog::info!(
logger,
"Computing ordinal number for Satoshi point {}:0:0 (block #{})",
transaction_identifier.hash,
block_identifier.index
)
});
let mut inscription_offset_intra_output = 0;
let mut inscription_output_index: usize = 0;
let mut ordinal_offset = 0;
Expand Down Expand Up @@ -984,6 +976,17 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
inscription_offset_intra_output = inscription_offset_cross_outputs - min;
}
}
ctx.try_log(|logger| {
slog::info!(
logger,
"Computing ordinal number for Satoshi point {} ({}:0 -> {}:{}) (block #{})",
transaction_identifier.hash,
input_index,
inscription_output_index,
inscription_offset_intra_output,
block_identifier.index
)
});

let mut tx_cursor: ([u8; 8], usize) = (txid, input_index);
let mut hops: u32 = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ pub fn generate_test_bitcoin_block(
parent_block_identifier,
timestamp: 0,
transactions,
metadata: BitcoinBlockMetadata {},
metadata: BitcoinBlockMetadata {
network: chainhook_types::BitcoinNetwork::Regtest,
},
}
}

Expand Down

0 comments on commit 5df77d7

Please sign in to comment.