Skip to content

Commit

Permalink
Add unhappy path for minting limit
Browse files Browse the repository at this point in the history
  • Loading branch information
eth-r committed Aug 3, 2023
1 parent 8ed32b7 commit 96a9ab9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cross-chain/solana/tests/02__wormholeGateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,25 @@ describe("wormhole-gateway", () => {
await checkCustodianState(program, authority, 20000);
});

it('- won\'t let non-authority update minting limit', async () => {
try {
await program.methods
.updateMintingLimit(new anchor.BN(20000))
.accounts({
custodian,
authority: impostorKeys.publicKey
})
.signers([impostorKeys])
.rpc();
chai.assert(false, "should've failed but didn't");
} catch (_err) {
expect(_err).to.be.instanceOf(AnchorError);
const err: AnchorError = _err;
expect(err.error.errorCode.code).to.equal('IsNotAuthority');
expect(err.program.equals(program.programId)).is.true;
}
});

it('deposit wrapped tokens', async () => {
// Set up new wallet
const payer = await generatePayer(connection, authority.payer);
Expand Down

0 comments on commit 96a9ab9

Please sign in to comment.