fix: transfer tracking

This commit is contained in:
Ludo Galabru
2023-07-06 17:05:33 -04:00
parent db1d584827
commit 30f299ef7c

View File

@@ -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,
@@ -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
@@ -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]