Skip to content

Commit

Permalink
refactor!: TraceAPI (ApeWorX#1864)
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Apr 22, 2024
1 parent 8b42350 commit 8d3a23f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ape_ethereum/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,10 @@ def _eth_call(self, arguments: list) -> HexBytes:

return HexBytes(result)

def _prepare_call(self, txn: TransactionAPI, **kwargs) -> list:
txn_dict = txn.model_dump(by_alias=True, mode="json")
def _prepare_call(self, txn: Union[TransactionAPI, dict], **kwargs) -> list:
txn_dict = (
txn.model_dump(by_alias=True, mode="json") if isinstance(txn, TransactionAPI) else txn
)
fields_to_convert = ("data", "chainId", "value")
for field in fields_to_convert:
value = txn_dict.get(field)
Expand Down

0 comments on commit 8d3a23f

Please sign in to comment.