Skip to content

Commit

Permalink
refactor: remove unnecessary line of validation (changes error msg)
Browse files Browse the repository at this point in the history
  • Loading branch information
fubuloubu committed Jun 30, 2022
1 parent 54c4a74 commit 4435f82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions contracts/supersig.vy
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ def revoke(id: uint256):

@external
def execute(id: uint256, target: address, calldata: Bytes[2000], amount: uint256):
# NOTE: Not necessary because the 3rd check also catches this condition
assert self.proposals[id].hash != EMPTY_BYTES32, "Proposal does not exist"
assert len(self.proposals[id].approvers) >= self.minimum, "Proposal has not been approved by the minimum number of owners"
assert self.proposals[id].hash == keccak256(_abi_encode(target, calldata, amount)), "Proposal hash does not match provided data"

Expand Down
4 changes: 2 additions & 2 deletions tests/test_supersig.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_fail_execute_does_not_exist(supersig, accounts):
supersig.execute(0, "0x000000000000000000000000000000000000dead", HexBytes("0x0"), 0, sender=accounts[0])
assert False
except ContractLogicError as e:
assert e.message == "Proposal does not exist"
assert e.message == "Proposal has not been approved by the minimum number of owners"


def test_fail_execute_twice(supersig, accounts):
Expand All @@ -149,7 +149,7 @@ def test_fail_execute_twice(supersig, accounts):
supersig.execute(3, target, calldata, value, sender=accounts[0])
assert False
except ContractLogicError as e:
assert e.message == "Proposal does not exist"
assert e.message == "Proposal has not been approved by the minimum number of owners"
assert accounts[4].balance == prev_balance

def test_fail_revoke_no_approval(supersig, accounts):
Expand Down

0 comments on commit 4435f82

Please sign in to comment.