Skip to content

Commit

Permalink
Merge pull request #713 from eth-brownie/fix-undo-call-as-tx
Browse files Browse the repository at this point in the history
Fix undo call as tx
  • Loading branch information
iamdefinitelyahuman authored Aug 6, 2020
2 parents 40bc052 + 04cac5f commit 8c5d5c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion brownie/network/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,12 +1123,13 @@ def __call__(self, *args: Tuple, block_identifier: Union[int, str, bytes] = None

try:
self.transact(*args, tx)
chain.undo()
except VirtualMachineError as exc:
pc, revert_msg = exc.pc, exc.revert_msg
chain.undo()
except Exception:
pass

chain.undo()
try:
return self.call(*args)
except VirtualMachineError as exc:
Expand Down
4 changes: 2 additions & 2 deletions tests/network/contract/test_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ def test_as_proxy_for(network):
original = Contract.from_explorer("0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b")
proxy = Contract.from_explorer(
"0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b",
as_proxy_for="0x9d0a0443ff4bb04391655b8cd205683d9fa75550",
as_proxy_for="0xAf601CbFF871d0BE62D18F79C31e387c76fa0374",
)
implementation = Contract("0x9d0a0443ff4bb04391655b8cd205683d9fa75550")
implementation = Contract("0xAf601CbFF871d0BE62D18F79C31e387c76fa0374")

assert original.abi == proxy.abi
assert original.address == proxy.address
Expand Down

0 comments on commit 8c5d5c9

Please sign in to comment.