Skip to content

Commit c3c91c6

Browse files
committed
Rename to clarify that dict_to_txn is for reads
1 parent dd1a32c commit c3c91c6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

trinity/rpc/modules/eth.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,13 @@ def get_block_at_number(chain: BaseChain, at_block: Union[str, int]) -> BaseBloc
9191
return chain.get_block_by_header(at_header)
9292

9393

94-
def dict_to_transaction(
94+
def dict_to_spoof_transaction(
9595
chain: BaseChain,
9696
header: BlockHeader,
9797
transaction_dict: Dict[str, Any]) -> SpoofTransaction:
98+
"""
99+
Convert dicts used in calls & gas estimates into a spoof transaction
100+
"""
98101
txn_dict = normalize_transaction_dict(transaction_dict)
99102
sender = txn_dict.get('from', ZERO_ADDRESS)
100103

@@ -140,7 +143,7 @@ def coinbase(self) -> Hash32:
140143
def estimateGas(self, txn_dict: Dict[str, Any], at_block: Union[str, int]) -> str:
141144
header = get_header(self._chain, at_block)
142145
validate_transaction_call_dict(txn_dict, self._chain.get_vm(header))
143-
transaction = dict_to_transaction(self._chain, header, txn_dict)
146+
transaction = dict_to_spoof_transaction(self._chain, header, txn_dict)
144147
gas = self._chain.estimate_gas(transaction, header)
145148
return hex(gas)
146149

0 commit comments

Comments
 (0)