From 02d273679792c78c4b73f24d9709a9ad99e16d77 Mon Sep 17 00:00:00 2001 From: Jon Cinque Date: Mon, 15 Nov 2021 18:56:23 +0100 Subject: [PATCH] token-js: Add test for disabling mint authority (#2582) --- token/js/cli/main.js | 3 +++ token/js/cli/token-test.js | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/token/js/cli/main.js b/token/js/cli/main.js index e44def70a57..17e080be7ba 100644 --- a/token/js/cli/main.js +++ b/token/js/cli/main.js @@ -9,6 +9,7 @@ import { createMint, createAccount, createAssociatedAccount, + disableMintAuthority, transfer, transferChecked, transferCheckedAssociated, @@ -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'); } diff --git a/token/js/cli/token-test.js b/token/js/cli/token-test.js index 6baba5946d8..4ad6308a29c 100644 --- a/token/js/cli/token-test.js +++ b/token/js/cli/token-test.js @@ -428,6 +428,16 @@ export async function setAuthority(): Promise { ); } +export async function disableMintAuthority(): Promise { + await testToken.setAuthority( + testToken.publicKey, + null, + 'MintTokens', + testMintAuthority, + [], + ); +} + export async function burn(): Promise { let accountInfo = await testToken.getAccountInfo(testAccount); const amount = accountInfo.amount.toNumber();