diff --git a/near-plugins-derive/tests/contracts/pausable/src/lib.rs b/near-plugins-derive/tests/contracts/pausable/src/lib.rs index 9d7fec9..8c66f4a 100644 --- a/near-plugins-derive/tests/contracts/pausable/src/lib.rs +++ b/near-plugins-derive/tests/contracts/pausable/src/lib.rs @@ -57,6 +57,7 @@ impl Counter { } /// Returns the value of the counter. + #[pause] pub fn get_counter(&self) -> u64 { self.counter } diff --git a/near-plugins-derive/tests/pausable.rs b/near-plugins-derive/tests/pausable.rs index 6f5604a..446285f 100644 --- a/near-plugins-derive/tests/pausable.rs +++ b/near-plugins-derive/tests/pausable.rs @@ -341,6 +341,18 @@ async fn test_not_paused_with_different_key() -> anyhow::Result<()> { Ok(()) } +#[tokio::test] +async fn test_view_call_of_pausable_method() -> anyhow::Result<()> { + let setup = Setup::new().await?; + let res = setup + .call_counter_modifier(&setup.unauth_account, "increase_1") + .await?; + assert_success_with_unit_return(res); + assert_eq!(setup.get_counter().await?, 1); + + Ok(()) +} + #[tokio::test] async fn test_work_after_unpause() -> anyhow::Result<()> { let setup = Setup::new().await?;