Apply fallback on non-sub storage (e.g. at) (#1004)

* Apply fallback on non-sub storage (e.g. at)

* Fallback test in rpc-code (getStorage)
This commit is contained in:
Jaco Greeff
2019-06-14 09:59:59 +02:00
committed by GitHub
parent 732936280a
commit 6d9699a090
3 changed files with 32 additions and 3 deletions
@@ -40,6 +40,19 @@ describe.skip('Promise e2e queries', () => {
expect(api.derive).toBeDefined();
});
it('allows retrieval of an fallback entry (once-off query)', async () => {
const nonce = await api.query.system.accountNonce('5DSo5RVtfrtgHoz2c7jK7Tca7FgJgpCzFnxoRVDeYUQcKPng');
expect(nonce.toHex()).toEqual('0x0000000000000000');
});
it('allows retrieval of fallback when at query is made', async () => {
const header = await api.rpc.chain.getHeader() as Header;
const nonce = await api.query.system.accountNonce.at(header.hash, '5DSo5RVtfrtgHoz2c7jK7Tca7FgJgpCzFnxoRVDeYUQcKPng');
expect(nonce.toHex()).toEqual('0x0000000000000000');
});
it('queries state for a balance', async () => {
return (
api.query.balances.freeBalance(keyring.alice.address, (balance) => {