Skip to content

Commit ee4346d

Browse files
committed
test(Safe): fix events check because of new event w/ SafeL2 instances
1 parent ea400d0 commit ee4346d

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

tests/functional/test_account.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def test_swap_owner(safe, accounts, OWNERS, exec_transaction):
2525
new_owner,
2626
)
2727

28-
assert receipt.events == [
28+
# NOTE: SafeL2 contracts have extra event
29+
assert receipt.events[-3:] == [
2930
safe.contract.RemovedOwner(owner=old_owner),
3031
safe.contract.AddedOwner(owner=new_owner),
3132
safe.contract.ExecutionSuccess(),
@@ -45,7 +46,8 @@ def test_add_owner(safe, accounts, OWNERS, exec_transaction):
4546
safe.confirmations_required,
4647
)
4748

48-
assert receipt.events == [
49+
# NOTE: SafeL2 contracts have extra event
50+
assert receipt.events[-2:] == [
4951
safe.contract.AddedOwner(owner=new_owner),
5052
safe.contract.ExecutionSuccess(),
5153
]
@@ -77,7 +79,8 @@ def test_remove_owner(safe, OWNERS, exec_transaction):
7779
]
7880
if threshold_changed:
7981
expected_events.insert(1, safe.contract.ChangedThreshold(threshold=new_threshold))
80-
assert receipt.events == expected_events
82+
# NOTE: SafeL2 contracts have extra event
83+
assert receipt.events[-len(expected_events) :] == expected_events
8184

8285
assert old_owner not in safe.signers
8386

tests/functional/test_guard.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ def test_add_guard(safe, guard, exec_transaction):
77
)
88

99
assert safe.guard == guard
10-
assert receipt.events == [
10+
11+
# NOTE: SafeL2 contracts have extra event
12+
assert receipt.events[-2:] == [
1113
safe.contract.ChangedGuard(guard),
1214
safe.contract.ExecutionSuccess(),
1315
]

tests/functional/test_modules.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ def test_add_module(safe, create_module, num_modules):
1111
receipt = safe.modules.enable(module)
1212

1313
assert module in safe.modules
14-
assert receipt.events == [
14+
15+
# NOTE: SafeL2 contracts have extra event
16+
assert receipt.events[-2:] == [
1517
safe.contract.EnabledModule(module),
1618
safe.contract.ExecutionSuccess(),
1719
]
@@ -28,7 +30,9 @@ def test_remove_module(safe, create_module, num_modules):
2830
for module in safe.modules:
2931
receipt = safe.modules.disable(module)
3032
assert module not in safe.modules
31-
assert receipt.events == [
33+
34+
# NOTE: SafeL2 contracts have extra event
35+
assert receipt.events[-2:] == [
3236
safe.contract.DisabledModule(module),
3337
safe.contract.ExecutionSuccess(),
3438
]

0 commit comments

Comments
 (0)