Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit d7473c3

Browse files
committed
get a transaction receipt for eth_getTransactionByHash
1 parent 0d5737a commit d7473c3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

etheno/jsonrpc.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
from .etheno import EthenoPlugin
55
from .utils import format_hex_address
66

7-
from dataclasses import asdict, dataclass
8-
from pprint import pprint
9-
from typing import Optional
10-
117

128
# source: https://ethereum.stackexchange.com/a/83855
139
import rlp
@@ -144,13 +140,17 @@ def after_post(self, post_data, result):
144140
return
145141
original_transaction = self._transactions[transaction_hash]
146142
if post_data['method'] == 'eth_getTransactionByHash':
147-
print('REQ eth_getTransactionByHash', original_transaction)
148-
print('RES eth_getTransactionByHash', result)
143+
self.logger.debug('REQ eth_getTransactionByHash', original_transaction)
144+
self.logger.debug('RES eth_getTransactionByHash', result)
149145
# we need to fetch the contractAddress if to == None,
150-
# however, for that we need the transaction receipt!!
151-
# now i would like to ugly hack call self.client.post(<get tx receipt>) here
152-
# but that ofcouse wont work, as there is no self.client
153-
return # to not break down below because result['result']['contractAddress'] does not exist
146+
# however, for that we need the transaction receipt!
147+
if self.etheno.master_client is None:
148+
return # there is no way to figure out the contract address
149+
receipt = self.etheno.master_client.wait_for_transaction(original_transaction)
150+
151+
# TODO @rmi7: I think the transaction receipt is what you need here,
152+
# but I am not sure what you need to do with it.
153+
154154
if 'value' not in original_transaction or original_transaction['value'] is None:
155155
value = '0x0'
156156
else:

0 commit comments

Comments
 (0)