Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 02d2736

Browse files
authored
token-js: Add test for disabling mint authority (#2582)
1 parent c6758a6 commit 02d2736

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

token/js/cli/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
createMint,
1010
createAccount,
1111
createAssociatedAccount,
12+
disableMintAuthority,
1213
transfer,
1314
transferChecked,
1415
transferCheckedAssociated,
@@ -67,6 +68,8 @@ async function main() {
6768
await multisig();
6869
console.log('Run test: nativeToken');
6970
await nativeToken();
71+
console.log('Run test: disable mint authority');
72+
await disableMintAuthority();
7073
console.log('Success\n');
7174
}
7275

token/js/cli/token-test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,16 @@ export async function setAuthority(): Promise<void> {
428428
);
429429
}
430430

431+
export async function disableMintAuthority(): Promise<void> {
432+
await testToken.setAuthority(
433+
testToken.publicKey,
434+
null,
435+
'MintTokens',
436+
testMintAuthority,
437+
[],
438+
);
439+
}
440+
431441
export async function burn(): Promise<void> {
432442
let accountInfo = await testToken.getAccountInfo(testAccount);
433443
const amount = accountInfo.amount.toNumber();

0 commit comments

Comments
 (0)