File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,10 @@ def create_unsigned_transaction(cls,
272
272
def get_canonical_transaction (self , transaction_hash : Hash32 ) -> BaseTransaction :
273
273
raise NotImplementedError ("Chain classes must implement this method" )
274
274
275
+ @abstractmethod
276
+ def get_transaction_receipt (self , transaction_hash : Hash32 ) -> Receipt :
277
+ raise NotImplementedError ("Chain classes must implement this method" )
278
+
275
279
#
276
280
# Execution API
277
281
#
@@ -653,6 +657,17 @@ def create_unsigned_transaction(self,
653
657
data = data ,
654
658
)
655
659
660
+ def get_transaction_receipt (self , transaction_hash : Hash32 ) -> Receipt :
661
+ transaction_block_number , transaction_index = self .chaindb .get_transaction_index (
662
+ transaction_hash ,
663
+ )
664
+ receipt = self .chaindb .get_receipt_by_index (
665
+ block_number = transaction_block_number ,
666
+ receipt_index = transaction_index ,
667
+ )
668
+
669
+ return receipt
670
+
656
671
#
657
672
# Execution API
658
673
#
Original file line number Diff line number Diff line change @@ -125,6 +125,12 @@ def get_block_transactions(
125
125
def get_block_transaction_hashes (self , block_header : BlockHeader ) -> Iterable [Hash32 ]:
126
126
raise NotImplementedError ("ChainDB classes must implement this method" )
127
127
128
+ @abstractmethod
129
+ def get_receipt_by_index (self ,
130
+ block_number : BlockNumber ,
131
+ receipt_index : int ) -> Receipt :
132
+ raise NotImplementedError ("ChainDB classes must implement this method" )
133
+
128
134
@abstractmethod
129
135
def get_receipts (self ,
130
136
header : BlockHeader ,
You can’t perform that action at this time.
0 commit comments