Skip to content

Commit

Permalink
testcase: update bank query test for token
Browse files Browse the repository at this point in the history
  • Loading branch information
fly33499 committed Nov 8, 2021
1 parent 69bb91d commit f923311
Showing 1 changed file with 48 additions and 2 deletions.
50 changes: 48 additions & 2 deletions test/05.bank_query.test.ts
Original file line number Diff line number Diff line change
@@ -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();

Expand All @@ -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");
});
});

0 comments on commit f923311

Please sign in to comment.