Skip to content

Commit

Permalink
chore: rename PausableHook -> Pausable (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
encody authored May 8, 2024
1 parent a82ae8f commit dc11f93
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ One may wish to combine the features of multiple macros in one contract. All of
```rust
use near_sdk_contract_tools::{
ft::*,
pause::{*, hooks::PausableHook},
pause::{*, hooks::Pausable},
Pause,
};
use near_sdk::{near, PanicOnDefault};

#[derive(FungibleToken, Pause, PanicOnDefault)]
#[fungible_token(all_hooks = "PausableHook")]
#[fungible_token(all_hooks = "Pausable")]
#[near(contract_state)]
struct Contract {}
```
Expand Down
4 changes: 2 additions & 2 deletions src/pause.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ pub mod hooks {
use super::Pause;

/// Ensures that a contract is unpaused before calling a method.
pub struct PausableHook;
pub struct Pausable;

impl<C, A> Hook<C, A> for PausableHook
impl<C, A> Hook<C, A> for Pausable
where
C: Pause,
{
Expand Down
4 changes: 2 additions & 2 deletions tests/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,12 @@ mod pausable_fungible_token {
use near_sdk_contract_tools::{
ft::*,
hook::Hook,
pause::{hooks::PausableHook, Pause},
pause::{hooks::Pausable, Pause},
Pause,
};

#[derive(FungibleToken, Pause, PanicOnDefault)]
#[fungible_token(all_hooks = "PausableHook", transfer_hook = "TransferHook")]
#[fungible_token(all_hooks = "Pausable", transfer_hook = "TransferHook")]
#[near(contract_state)]
struct Contract {
pub storage_usage: u64,
Expand Down
4 changes: 2 additions & 2 deletions tests/macros/standard/nep171/non_fungible_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ use near_sdk::{env, near, PanicOnDefault};
use near_sdk_contract_tools::{
nft::*,
owner::Owner,
pause::{hooks::PausableHook, Pause},
pause::{hooks::Pausable, Pause},
Owner, Pause,
};

#[derive(NonFungibleToken, Pause, Owner, PanicOnDefault)]
#[non_fungible_token(transfer_hook = "PausableHook")]
#[non_fungible_token(transfer_hook = "Pausable")]
#[near(contract_state)]
pub struct Contract {
next_token_id: u32,
Expand Down

0 comments on commit dc11f93

Please sign in to comment.