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:
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user