From f923311b2213d6a9869f22b4f254a9c85874dc39 Mon Sep 17 00:00:00 2001 From: fly33499 Date: Mon, 8 Nov 2021 14:59:37 +0900 Subject: [PATCH] testcase: update bank query test for token --- test/05.bank_query.test.ts | 50 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/test/05.bank_query.test.ts b/test/05.bank_query.test.ts index 8c7a7cc..77db1b2 100644 --- a/test/05.bank_query.test.ts +++ b/test/05.bank_query.test.ts @@ -1,12 +1,12 @@ import { expect } from 'chai'; import { FirmaSDK } from "../sdk/FirmaSDK" -import { TestChainConfig } from './config_test'; +import { aliceMnemonic, TestChainConfig } from './config_test'; describe('[05. Bank test]', () => { const firma = new FirmaSDK(TestChainConfig); - it('Get Balance() of a user who has never been created.', async () => { + it('Bank getBalance() of a user who has never been created.', async () => { const wallet = await firma.Wallet.newWallet(); @@ -17,4 +17,50 @@ describe('[05. Bank test]', () => { expect(result2).to.be.equal("0"); }); + it('Bank getBalance()', async () => { + + const wallet = await firma.Wallet.fromMnemonic(aliceMnemonic); + var result = await firma.Bank.getBalance(await wallet.getAddress()); + + //expect(result).to.be.equal("0"); + }); + + it('Bank getTokenBalance()', async () => { + + // for single usage + const tokenID = "ukomx6" + + const wallet = await firma.Wallet.fromMnemonic(aliceMnemonic); + var result = await firma.Bank.getTokenBalance(await wallet.getAddress(), tokenID); + + console.log(result); + + //expect(result).to.be.equal("0"); + }); + + it('Bank getTokenBalance() - not exist tokenID', async () => { + + // for single usage + const tokenID = "ukomx6sdfakljfd" + + const wallet = await firma.Wallet.fromMnemonic(aliceMnemonic); + var result = await firma.Bank.getTokenBalance(await wallet.getAddress(), tokenID); + expect(result).to.be.equal("0"); + + //console.log(result); + //expect(result).to.be.equal("0"); + }); + + + it('Bank getTokenBalanceList()', async () => { + + // for wallet application + const wallet = await firma.Wallet.fromMnemonic(aliceMnemonic); + var result = await firma.Bank.getTokenBalanceList(await wallet.getAddress()); + + //console.log(result); + //result[0].denom + //result[0].amount + //expect(result).to.be.equal("0"); + }); }); \ No newline at end of file