Skip to content

Commit

Permalink
remove eth_getTransactionByHash
Browse files Browse the repository at this point in the history
  • Loading branch information
rmi7 committed Sep 20, 2021
1 parent d7473c3 commit 57dcab5
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions etheno/jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ def after_post(self, post_data, result):
result = result[0]
if 'method' not in post_data:
return
# print('POST DATA', post_data)
# print('RESULT', result)
elif (post_data['method'] == 'eth_sendTransaction' or post_data['method'] == 'eth_sendRawTransaction') and 'result' in result:
try:
transaction_hash = int(result['result'], 16)
Expand All @@ -133,24 +131,12 @@ def after_post(self, post_data, result):
self.handle_increase_block_number()
elif post_data['method'] == 'evm_increaseTime':
self.handle_increase_block_timestamp(post_data['params'][0])
elif post_data['method'] == 'eth_getTransactionReceipt' or post_data['method'] == 'eth_getTransactionByHash':
elif post_data['method'] == 'eth_getTransactionReceipt':
transaction_hash = int(post_data['params'][0], 16)
if transaction_hash not in self._transactions:
self.logger.error(f'Received transaction receipt {result} for unknown transaction hash {post_data["params"][0]}')
return
original_transaction = self._transactions[transaction_hash]
if post_data['method'] == 'eth_getTransactionByHash':
self.logger.debug('REQ eth_getTransactionByHash', original_transaction)
self.logger.debug('RES eth_getTransactionByHash', result)
# we need to fetch the contractAddress if to == None,
# however, for that we need the transaction receipt!
if self.etheno.master_client is None:
return # there is no way to figure out the contract address
receipt = self.etheno.master_client.wait_for_transaction(original_transaction)

# TODO @rmi7: I think the transaction receipt is what you need here,
# but I am not sure what you need to do with it.

if 'value' not in original_transaction or original_transaction['value'] is None:
value = '0x0'
else:
Expand Down

0 comments on commit 57dcab5

Please sign in to comment.