Skip to content

Commit

Permalink
token-js: Add test for disabling mint authority (solana-labs#2582)
Browse files Browse the repository at this point in the history
  • Loading branch information
joncinque authored Nov 15, 2021
1 parent c6758a6 commit 02d2736
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions token/js/cli/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
createMint,
createAccount,
createAssociatedAccount,
disableMintAuthority,
transfer,
transferChecked,
transferCheckedAssociated,
Expand Down Expand Up @@ -67,6 +68,8 @@ async function main() {
await multisig();
console.log('Run test: nativeToken');
await nativeToken();
console.log('Run test: disable mint authority');
await disableMintAuthority();
console.log('Success\n');
}

Expand Down
10 changes: 10 additions & 0 deletions token/js/cli/token-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,16 @@ export async function setAuthority(): Promise<void> {
);
}

export async function disableMintAuthority(): Promise<void> {
await testToken.setAuthority(
testToken.publicKey,
null,
'MintTokens',
testMintAuthority,
[],
);
}

export async function burn(): Promise<void> {
let accountInfo = await testToken.getAccountInfo(testAccount);
const amount = accountInfo.amount.toNumber();
Expand Down

0 comments on commit 02d2736

Please sign in to comment.