Skip to content

Commit

Permalink
fix: move silent kwarg to avoid decode error
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdefinitelyahuman committed Feb 2, 2024
1 parent a5b69b1 commit f19b459
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions brownie/network/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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):
Expand Down
5 changes: 2 additions & 3 deletions brownie/network/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)

Expand All @@ -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
Expand Down

0 comments on commit f19b459

Please sign in to comment.