From 678b00cbcc535b160db02df2d499461c7013ab05 Mon Sep 17 00:00:00 2001 From: heswithme Date: Wed, 23 Oct 2024 14:50:47 +0200 Subject: [PATCH] test: adding unit tests for events --- tests/unitary/deposit_limit_module/test_set_deposit_limit.py | 4 ++++ .../unitary/deposit_limit_module/test_set_deposits_paused.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tests/unitary/deposit_limit_module/test_set_deposit_limit.py b/tests/unitary/deposit_limit_module/test_set_deposit_limit.py index 614daad..34d5759 100644 --- a/tests/unitary/deposit_limit_module/test_set_deposit_limit.py +++ b/tests/unitary/deposit_limit_module/test_set_deposit_limit.py @@ -9,6 +9,10 @@ def test_default_behavior(deposit_limit_module, dev_multisig): with boa.env.prank(dev_multisig): deposit_limit_module.set_deposit_limit(new_limit) + # Verify event emission + events = deposit_limit_module.get_logs() + assert f"DepositLimitChanged(new_deposit_limit={new_limit}" in repr(events) + # Verify that max_deposit_limit has been updated correctly assert deposit_limit_module.max_deposit_limit() == new_limit diff --git a/tests/unitary/deposit_limit_module/test_set_deposits_paused.py b/tests/unitary/deposit_limit_module/test_set_deposits_paused.py index 710f11b..ab8d9da 100644 --- a/tests/unitary/deposit_limit_module/test_set_deposits_paused.py +++ b/tests/unitary/deposit_limit_module/test_set_deposits_paused.py @@ -9,6 +9,10 @@ def test_default_behavior( with boa.env.prank(dev_multisig): deposit_limit_module.set_deposits_paused(True) + # Verify event emission + events = deposit_limit_module.get_logs() + assert f"DepositsPaused(status={True}" in repr(events) + # Verify that deposits are paused assert deposit_limit_module.deposits_paused()