Move Event, Address, AccountId, AccountIndex to generic (#1202)

* Move Event, Address, AccountId, AccountIndex to generic

* Move AccountId, AccountIndex, Address & Event to generic

* Move Vote
This commit is contained in:
Jaco Greeff
2019-07-26 16:39:28 +02:00
committed by GitHub
parent 894f07e3c9
commit 02cd1331aa
69 changed files with 247 additions and 246 deletions
+2 -2
View File
@@ -4,7 +4,7 @@
import testingPairs from '@polkadot/keyring/testingPairs';
import MockProvider from '@polkadot/rpc-provider/mock';
import { AccountId } from '@polkadot/types';
import { createType } from '@polkadot/types';
import Rpc from '.';
@@ -32,7 +32,7 @@ describe('Cached Observables', (): void => {
it('creates a single observable (multiple calls, different arguments that should be cached together)', (): void => {
const observable1 = rpc.chain.subscribeNewHead(keyring.alice.address);
const observable2 = rpc.chain.subscribeNewHead(new AccountId(keyring.alice.address));
const observable2 = rpc.chain.subscribeNewHead(createType('AccountId', keyring.alice.address));
expect(observable2).toBe(observable1);
});
+1 -1
View File
@@ -246,7 +246,7 @@ export default class Rpc implements RpcInterface {
length: false,
// Normalize args so that different args that should be cached
// together are cached together.
// E.g.: `query.my.method('abc') === query.my.method(new AccountId('abc'));`
// E.g.: `query.my.method('abc') === query.my.method(createType('AccountId', 'abc'));`
normalizer: JSON.stringify
});