Skip to content
Open
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
14 changes: 11 additions & 3 deletions tests/emergency_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ Clarinet.test({
async fn(chain: Chain, accounts: Map<string, Account>) {
const deployer = accounts.get('deployer')!;

chain.mineBlock([
// Capture the setup block
let setupBlock = chain.mineBlock([
Tx.contractCall('emergency', 'emergency-pause', [
types.ascii('Test pause')
], deployer.address)
]);

// Actively assert the setup succeeded before querying state
setupBlock.receipts[0].result.expectOk();

let status = chain.callReadOnlyFn('emergency', 'is-paused', [], deployer.address);
assertEquals(status.result.expectOk(), types.bool(true));
}
Expand All @@ -37,16 +41,20 @@ Clarinet.test({
async fn(chain: Chain, accounts: Map<string, Account>) {
const deployer = accounts.get('deployer')!;

chain.mineBlock([
// Capture the setup block
let setupBlock = chain.mineBlock([
Tx.contractCall('emergency', 'emergency-pause', [
types.ascii('Test pause')
], deployer.address)
]);

// Actively assert the setup succeeded before trying to resume
setupBlock.receipts[0].result.expectOk();

let block = chain.mineBlock([
Tx.contractCall('emergency', 'resume-operations', [], deployer.address)
]);

assertEquals(block.receipts[0].result.expectOk(), types.uint(1));
}
});
});