diff --git a/contracts/feature-tests/use-module/scenarios/use_module_pause.scen.json b/contracts/feature-tests/use-module/scenarios/use_module_pause.scen.json index c96bb34cc9..bd8a21bc44 100644 --- a/contracts/feature-tests/use-module/scenarios/use_module_pause.scen.json +++ b/contracts/feature-tests/use-module/scenarios/use_module_pause.scen.json @@ -70,7 +70,7 @@ "expect": { "out": [], "status": "", - "logs": [], + "logs": "*", "gas": "*", "refund": "*" } @@ -110,7 +110,7 @@ "expect": { "out": [], "status": "", - "logs": [], + "logs": "*", "gas": "*", "refund": "*" } @@ -137,4 +137,4 @@ } } ] -} +} \ No newline at end of file diff --git a/contracts/feature-tests/use-module/use_module_expected_main.abi.json b/contracts/feature-tests/use-module/use_module_expected_main.abi.json index e8eac7ffbc..8dab13be57 100644 --- a/contracts/feature-tests/use-module/use_module_expected_main.abi.json +++ b/contracts/feature-tests/use-module/use_module_expected_main.abi.json @@ -1000,6 +1000,14 @@ "type": "EsdtTokenPayment" } ] + }, + { + "identifier": "pauseContract", + "inputs": [] + }, + { + "identifier": "unpauseContract", + "inputs": [] } ], "esdtAttributes": [ diff --git a/contracts/feature-tests/use-module/use_module_expected_view.abi.json b/contracts/feature-tests/use-module/use_module_expected_view.abi.json index 3bd3819f58..9b117b8be7 100644 --- a/contracts/feature-tests/use-module/use_module_expected_view.abi.json +++ b/contracts/feature-tests/use-module/use_module_expected_view.abi.json @@ -244,6 +244,14 @@ "type": "EsdtTokenPayment" } ] + }, + { + "identifier": "pauseContract", + "inputs": [] + }, + { + "identifier": "unpauseContract", + "inputs": [] } ], "esdtAttributes": [ diff --git a/contracts/modules/src/pause.rs b/contracts/modules/src/pause.rs index a02be8b5cc..db877a0d56 100644 --- a/contracts/modules/src/pause.rs +++ b/contracts/modules/src/pause.rs @@ -30,14 +30,14 @@ pub trait PauseModule { #[endpoint(pause)] fn pause_endpoint(&self) { self.set_paused(true); - // TODO: event + self.pause_event(); } #[only_owner] #[endpoint(unpause)] fn unpause_endpoint(&self) { self.set_paused(false); - // TODO: event + self.unpause_event(); } fn require_paused(&self) { @@ -48,6 +48,12 @@ pub trait PauseModule { require!(self.not_paused(), "Contract is paused"); } + #[event("pauseContract")] + fn pause_event(&self); + + #[event("unpauseContract")] + fn unpause_event(&self); + #[view(isPaused)] #[storage_mapper("pause_module:paused")] fn paused_status(&self) -> SingleValueMapper;