availableBalance should be >0 (#963)

* availableBalance should be >0

* Remove double >0 check

* Add e2e test
This commit is contained in:
Jaco Greeff
2019-06-12 16:45:45 +12:00
committed by Ian He
parent 8de8e3511c
commit e4400f0a26
3 changed files with 36 additions and 18 deletions
+12 -3
View File
@@ -10,8 +10,8 @@ import ApiPromise from '@plugnet/api/promise/Api';
import testKeyring from '@plugnet/keyring/testing';
import { WsProvider } from '@plugnet/rpc-provider';
const WS = 'ws://127.0.0.1:9944/';
// const WS = 'wss://poc3-rpc.polkadot.io/';
// const WS = 'ws://127.0.0.1:9944/';
const WS = 'wss://poc3-rpc.polkadot.io/';
describe.skip('derive e2e', () => {
let api: ApiPromise;
@@ -62,6 +62,16 @@ describe.skip('derive e2e', () => {
});
});
it('retrieves balances for a problematic account', (done) => {
return api.derive.balances.all('5F7BJL6Z4m8RLtK7nXEqqpEqhBbd535Z3CZeYF6ccvaQAY6N', (balance) => {
console.error(JSON.stringify(balance));
if (balance.availableBalance.eqn(0)) {
done();
}
});
});
it('retrieves all session info', (done) => {
let count = 0;
@@ -144,5 +154,4 @@ describe.skip('derive e2e', () => {
});
});
});
});