Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions near-plugins/src/pausable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,23 @@ mod tests {
assert_eq!(counter.counter, 0);
}

/// Verify `except` escape hatch works when the feature is paused via `ALL`.
#[test]
fn test_pause_with_all_allows_except() {
let (mut counter, mut ctx) = setup_basic();

// Pause `ALL`.
ctx.predecessor_account_id = "anna.test".to_string().try_into().unwrap();
testing_env!(ctx.clone());
counter.pa_pause_feature("ALL".to_string());

// Call paused function from exempted account.
ctx.predecessor_account_id = "brenda.test".to_string().try_into().unwrap();
testing_env!(ctx.clone());
counter.increase_4();
assert_eq!(counter.counter, 4);
}

#[test]
fn test_not_paused_with_different_key() {
let (mut counter, mut ctx) = setup_basic();
Expand Down