From f19b4593b3c735509ab4d8e82a02728efa71ac67 Mon Sep 17 00:00:00 2001 From: Ben Hauser Date: Fri, 2 Feb 2024 21:15:18 +0400 Subject: [PATCH] fix: move silent kwarg to avoid decode error --- brownie/network/contract.py | 4 ++-- brownie/network/transaction.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/brownie/network/contract.py b/brownie/network/contract.py index 102ff9f24..7978ca33c 100644 --- a/brownie/network/contract.py +++ b/brownie/network/contract.py @@ -1627,7 +1627,7 @@ def call( except: raise ValueError(f"Call reverted: {decode_typed_error(data)}") from None - def transact(self, silent: bool = False, *args: Tuple) -> TransactionReceiptType: + def transact(self, *args: Tuple, silent: bool = False) -> TransactionReceiptType: """ Broadcast a transaction that calls this contract method. @@ -1778,7 +1778,7 @@ def __call__(self, *args: Tuple, silent: bool = False) -> TransactionReceiptType Object representing the broadcasted transaction. """ - return self.transact(silent, *args) + return self.transact(*args, silent=silent) class ContractCall(_ContractMethod): diff --git a/brownie/network/transaction.py b/brownie/network/transaction.py index f7e3d8c61..9e561f65e 100644 --- a/brownie/network/transaction.py +++ b/brownie/network/transaction.py @@ -81,7 +81,6 @@ class Status(IntEnum): class TransactionReceipt: - """Attributes and methods relating to a broadcasted transaction. * All ether values are given as integers denominated in wei. @@ -551,7 +550,7 @@ def _set_from_tx(self, tx: Dict) -> None: self.max_fee = tx.get("maxFeePerGas") self.priority_fee = tx.get("maxPriorityFeePerGas") self.gas_limit = tx["gas"] - self.input = tx["input"] + self.input = tx["input"].hex() self.nonce = tx["nonce"] self.type = int(HexBytes(tx.get("type", 0)).hex(), 16) @@ -562,7 +561,7 @@ def _set_from_tx(self, tx: Dict) -> None: contract = state._find_contract(tx.get("to")) if contract is not None: self.contract_name = contract._name - self.fn_name = contract.get_method(tx["input"]) + self.fn_name = contract.get_method(tx["input"].hex()) except ContractNotFound: # required in case the contract has self destructed # other aspects of functionality will be broken, but this way we