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
+1 -2
View File
@@ -10,7 +10,6 @@ import { AddressOrPair, SignerOptions, SubmittableExtrinsic, SubmittablePaymentR
import { Observable, combineLatest, of } from 'rxjs';
import { first, map, mapTo, mergeMap, switchMap, tap } from 'rxjs/operators';
import { ClassOf } from '@polkadot/types';
import { assert, isBn, isFunction, isNumber, isUndefined } from '@polkadot/util';
import { filterEvents, isKeyringPair } from '../util';
@@ -32,7 +31,7 @@ const DEFAULT_MORTAL_LENGTH = 5 * ONE_MINUTE;
export default function createClass <ApiType extends ApiTypes> ({ api, apiType, decorateMethod }: SubmittableOptions<ApiType>): Constructor<SubmittableExtrinsic<ApiType>> {
// an instance of the base extrinsic for us to extend
const Extrinsic = ClassOf(api.registry, 'Extrinsic');
const Extrinsic = api.registry.createClass('Extrinsic');
return class Submittable extends Extrinsic implements SubmittableExtrinsic<ApiType> {
readonly #ignoreStatusCb: boolean;