@@ -6,6 +6,7 @@ use anyhow::anyhow;
66use async_trait:: async_trait;
77use graph:: abi;
88use graph:: prelude:: alloy;
9+ use graph:: prelude:: alloy:: consensus:: TxReceipt ;
910use graph:: prelude:: alloy:: network:: ReceiptResponse ;
1011use graph:: prelude:: alloy:: rpc:: types:: { Log , TransactionReceipt } ;
1112use graph:: prelude:: alloy:: serde:: WithOtherFields ;
@@ -697,6 +698,10 @@ impl ToAscObj<AscEthereumTransactionReceipt>
697698 . ok_or ( HostExportError :: Unknown ( anyhow ! (
698699 "Transaction index is missing"
699700 ) ) ) ?;
701+ let status = match self . inner . status_or_post_state ( ) . as_eip658 ( ) {
702+ Some ( success) => asc_new ( heap, & BigInt :: from ( success as u64 ) , gas) . await ?,
703+ None => AscPtr :: null ( ) , // Pre-EIP-658 (pre-Byzantium) receipt
704+ } ;
700705 Ok ( AscEthereumTransactionReceipt {
701706 transaction_hash : asc_new ( heap, & self . transaction_hash , gas) . await ?,
702707 transaction_index : asc_new ( heap, & BigInt :: from ( transaction_index) , gas) . await ?,
@@ -707,7 +712,7 @@ impl ToAscObj<AscEthereumTransactionReceipt>
707712 gas_used : asc_new ( heap, & BigInt :: from ( self . gas_used ) , gas) . await ?,
708713 contract_address : asc_new_or_null ( heap, & self . contract_address , gas) . await ?,
709714 logs : asc_new ( heap, & self . logs ( ) , gas) . await ?,
710- status : asc_new ( heap , & BigInt :: from ( self . status ( ) as u64 ) , gas ) . await ? ,
715+ status,
711716 root : asc_new_or_null ( heap, & self . state_root ( ) , gas) . await ?,
712717 logs_bloom : asc_new ( heap, self . inner . bloom ( ) . as_slice ( ) , gas) . await ?,
713718 } )
0 commit comments