Allow construction of HashMap (#1955)

* Allow construction of HashMap

* WIP... add Map to codec, extend BTreeMap & HashMap from it

* Rework various map tests

* registry.createClass

* createClass in tests
This commit is contained in:
Jaco Greeff
2020-02-26 21:30:38 +01:00
committed by GitHub
parent e31966496b
commit 85ae6f949b
38 changed files with 467 additions and 351 deletions
@@ -9,12 +9,12 @@ import { Observable, of } from 'rxjs';
import { map, startWith } from 'rxjs/operators';
import { ApiInterfaceRx } from '@polkadot/api/types';
import { ENUMSET_SIZE } from '@polkadot/types/generic/AccountIndex';
import { ClassOf, Option, Vec, createType } from '@polkadot/types';
import { Option, Vec, createType } from '@polkadot/types';
import { memo } from '../util';
function queryEnumSet (api: ApiInterfaceRx, _accountIndex: AccountIndex | string): Observable<AccountId | undefined> {
const accountIndex = _accountIndex instanceof ClassOf(api.registry, 'AccountIndex')
const accountIndex = _accountIndex instanceof api.registry.createClass('AccountIndex')
? _accountIndex
: createType(api.registry, 'AccountIndex', _accountIndex);