Skip to content

Commit 30f299e

Browse files
author
Ludo Galabru
committed
fix: transfer tracking
1 parent db1d584 commit 30f299e

File tree

1 file changed

+10
-2
lines changed
  • components/hord-cli/src/hord

1 file changed

+10
-2
lines changed

components/hord-cli/src/hord/mod.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ pub fn update_storage_and_augment_bitcoin_block_with_inscription_transfer_data(
653653
// todo: handle ordinals coinbase spend
654654

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

682-
let (_, input_index) = parse_outpoint_to_watch(&outpoint_pre_transfer);
683682
let inputs = new_tx
684683
.metadata
685684
.inputs
@@ -976,6 +975,15 @@ fn test_identify_next_output_index_destination() {
976975
compute_next_satpoint_data(2, 45, &vec![20, 30, 45], &vec![20, 30, 45]),
977976
SatPosition::Fee(0)
978977
);
978+
assert_eq!(
979+
compute_next_satpoint_data(
980+
2,
981+
0,
982+
&vec![1000, 600, 546, 63034],
983+
&vec![1600, 10000, 15000]
984+
),
985+
SatPosition::Output((1, 0))
986+
);
979987
}
980988

981989
#[test]

0 commit comments

Comments
 (0)