Skip to content

Commit

Permalink
fix: transfer tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru committed Jul 6, 2023
1 parent db1d584 commit 30f299e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions components/hord-cli/src/hord/mod.rs
Expand Up @@ -653,7 +653,7 @@ pub fn update_storage_and_augment_bitcoin_block_with_inscription_transfer_data(
// todo: handle ordinals coinbase spend

for (tx_index, new_tx) in block.transactions.iter_mut().skip(1).enumerate() {
for input in new_tx.metadata.inputs.iter() {
for (input_index, input) in new_tx.metadata.inputs.iter().enumerate() {
// input.previous_output.txid
let outpoint_pre_transfer = format_outpoint_to_watch(
&input.previous_output.txid,
Expand All @@ -679,7 +679,6 @@ pub fn update_storage_and_augment_bitcoin_block_with_inscription_transfer_data(
// Question is: are inscriptions moving to a new output,
// burnt or lost in fees and transfered to the miner?

let (_, input_index) = parse_outpoint_to_watch(&outpoint_pre_transfer);
let inputs = new_tx
.metadata
.inputs
Expand Down Expand Up @@ -976,6 +975,15 @@ fn test_identify_next_output_index_destination() {
compute_next_satpoint_data(2, 45, &vec![20, 30, 45], &vec![20, 30, 45]),
SatPosition::Fee(0)
);
assert_eq!(
compute_next_satpoint_data(
2,
0,
&vec![1000, 600, 546, 63034],
&vec![1600, 10000, 15000]
),
SatPosition::Output((1, 0))
);
}

#[test]
Expand Down

0 comments on commit 30f299e

Please sign in to comment.