File tree 2 files changed +16
-7
lines changed
chainhook-event-observer/src/indexer/bitcoin
2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ pub async fn scan_bitcoin_chain_with_predicate(
200
200
& transaction. transaction_identifier ,
201
201
& ctx_,
202
202
) ;
203
- let ( block_number, block_offset) = match res {
203
+ let ( block_number, block_offset, _ ) = match res {
204
204
Ok ( res) => res,
205
205
Err ( err) => {
206
206
println ! ( "{err}" ) ;
Original file line number Diff line number Diff line change @@ -274,10 +274,13 @@ pub fn standardize_bitcoin_block(
274
274
sats_in += value;
275
275
inputs. push ( TxIn {
276
276
previous_output : OutPoint {
277
- txid : input
278
- . txid
279
- . expect ( "not provided for coinbase txs" )
280
- . to_string ( ) ,
277
+ txid : format ! (
278
+ "0x{}" ,
279
+ input
280
+ . txid
281
+ . expect( "not provided for coinbase txs" )
282
+ . to_string( )
283
+ ) ,
281
284
vout : input. vout . expect ( "not provided for coinbase txs" ) ,
282
285
block_height : input. prevout . expect ( "not provided for coinbase txs" ) . height ,
283
286
value,
@@ -366,6 +369,12 @@ fn try_parse_ordinal_operation(
366
369
index : 0 ,
367
370
} ;
368
371
372
+ let inscription_fee = tx
373
+ . vout
374
+ . get ( 0 )
375
+ . and_then ( |o| Some ( o. value . to_sat ( ) ) )
376
+ . unwrap_or ( 0 ) ;
377
+
369
378
let no_content_bytes = vec ! [ ] ;
370
379
let inscription_content_bytes = inscription. body ( ) . unwrap_or ( & no_content_bytes) ;
371
380
@@ -385,12 +394,12 @@ fn try_parse_ordinal_operation(
385
394
content_length : inscription_content_bytes. len ( ) ,
386
395
inscription_id : inscription_id. to_string ( ) ,
387
396
inscriber_address,
397
+ inscription_fee,
388
398
inscription_number : 0 ,
389
- inscription_fee : 0 ,
390
399
ordinal_number : 0 ,
391
400
ordinal_block_height : 0 ,
392
401
ordinal_offset : 0 ,
393
- outpoint_post_inscription : format ! ( "{}:0:0" , tx. txid. clone( ) ) ,
402
+ satpoint_post_inscription : format ! ( "{}:0:0" , tx. txid. clone( ) ) ,
394
403
} ,
395
404
) ) ;
396
405
}
You can’t perform that action at this time.
0 commit comments