chore: fix token tests (#11975)

This commit is contained in:
Justin Starry
2020-09-02 01:58:40 +08:00
committed by GitHub
parent 7341e60043
commit d1c08d0b04
4 changed files with 22 additions and 56 deletions

View File

@ -1326,7 +1326,7 @@ test('get supply', async () => {
});
const TOKEN_PROGRAM_ID = new PublicKey(
'TokenSVp5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o',
'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
);
describe('token methods', () => {
@ -1353,28 +1353,30 @@ describe('token methods', () => {
const mintOwner = new Account();
const accountOwner = new Account();
const [token, tokenAccount] = await Token.createMint(
const token = await Token.createMint(
connection,
payerAccount,
mintOwner.publicKey,
accountOwner.publicKey,
new u64(11111),
null,
2,
TOKEN_PROGRAM_ID,
false,
);
await Token.createMint(
const tokenAccount = await token.createAccount(accountOwner.publicKey);
await token.mintTo(tokenAccount, mintOwner, [], 11111);
const token2 = await Token.createMint(
connection,
payerAccount,
mintOwner.publicKey,
accountOwner.publicKey,
new u64(10000),
null,
2,
TOKEN_PROGRAM_ID,
false,
);
const token2Account = await token2.createAccount(accountOwner.publicKey);
await token2.mintTo(token2Account, mintOwner, [], 100);
const tokenAccountDest = await token.createAccount(accountOwner.publicKey);
testSignature = await token.transfer(
tokenAccount,