|
4 | 4 | from .etheno import EthenoPlugin
|
5 | 5 | from .utils import format_hex_address
|
6 | 6 |
|
7 |
| -from dataclasses import asdict, dataclass |
8 |
| -from pprint import pprint |
9 |
| -from typing import Optional |
10 |
| - |
11 | 7 |
|
12 | 8 | # source: https://ethereum.stackexchange.com/a/83855
|
13 | 9 | import rlp
|
@@ -144,13 +140,17 @@ def after_post(self, post_data, result):
|
144 | 140 | return
|
145 | 141 | original_transaction = self._transactions[transaction_hash]
|
146 | 142 | 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) |
149 | 145 | # 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 | + |
154 | 154 | if 'value' not in original_transaction or original_transaction['value'] is None:
|
155 | 155 | value = '0x0'
|
156 | 156 | else:
|
|
0 commit comments