@@ -3,7 +3,7 @@ pub mod ordinals;
3
3
4
4
use chainhook_sdk:: bitcoincore_rpc:: bitcoin:: hashes:: hex:: FromHex ;
5
5
use chainhook_sdk:: bitcoincore_rpc:: bitcoin:: { Address , Network , Script } ;
6
- use chainhook_sdk:: bitcoincore_rpc_json:: bitcoin:: Witness ;
6
+ use chainhook_sdk:: bitcoincore_rpc_json:: bitcoin:: { Txid , Witness } ;
7
7
use chainhook_sdk:: types:: {
8
8
BitcoinBlockData , BitcoinNetwork , OrdinalInscriptionCurseType , OrdinalInscriptionRevealData ,
9
9
OrdinalInscriptionTransferData , OrdinalOperation , TransactionIdentifier ,
@@ -102,12 +102,16 @@ pub fn parse_ordinal_operations(
102
102
let mut operations = vec ! [ ] ;
103
103
for ( input_index, input) in tx. vin . iter ( ) . enumerate ( ) {
104
104
if let Some ( ref witness_data) = input. txinwitness {
105
- let witness = Witness :: from_vec ( witness_data. clone ( ) ) ;
105
+ let witness_data_hex: Vec < Vec < u8 > > = witness_data
106
+ . iter ( )
107
+ . map ( |w| hex:: decode ( w) . unwrap ( ) )
108
+ . collect ( ) ;
109
+ let witness = Witness :: from_vec ( witness_data_hex. clone ( ) ) ;
106
110
let mut inscription = match InscriptionParser :: parse ( & witness) {
107
111
Ok ( inscription) => inscription,
108
112
Err ( _e) => {
109
113
let mut cursed_inscription = None ;
110
- for bytes in witness_data . iter ( ) {
114
+ for bytes in witness_data_hex . iter ( ) {
111
115
let script = Script :: from ( bytes. to_vec ( ) ) ;
112
116
let parser = InscriptionParser {
113
117
instructions : script. instructions ( ) . peekable ( ) ,
@@ -129,7 +133,7 @@ pub fn parse_ordinal_operations(
129
133
} ;
130
134
131
135
let inscription_id = InscriptionId {
132
- txid : tx. txid . clone ( ) ,
136
+ txid : Txid :: from_hex ( & tx. txid ) . unwrap ( ) ,
133
137
index : input_index as u32 ,
134
138
} ;
135
139
0 commit comments