1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 'use strict'
- const expect = require('chai').expect
- const { RuntimeApi } = require('@joystream/storage-runtime-api')
- describe('Balances', () => {
- let api
- let key
- before(async () => {
- api = await RuntimeApi.create()
- key = await api.identities.loadUnlock('test/data/edwards_unlocked.json')
- })
- it('returns free balance for an account', async () => {
- const balance = await api.balances.freeBalance(key.address)
-
- expect(balance.cmpn(0)).to.equal(0)
- })
- it('checks whether a minimum balance exists', async () => {
-
- expect(await api.balances.hasMinimumBalanceOf(key.address, 0)).to.be.true
- expect(await api.balances.hasMinimumBalanceOf(key.address, 1)).to.be.false
- })
- it('returns the base transaction fee of the chain', async () => {
- const fee = await api.balances.baseTransactionFee()
-
- expect(fee.cmpn(0)).to.be.at.least(0)
- })
- })
|