diff --git a/package.json b/package.json index 895ec8baf3..24a872848e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.77.1", + "version": "0.0.0", "private": true, "engines": { "node": ">=10.13.0", @@ -13,20 +13,20 @@ "typescript": "^3.4.3" }, "scripts": { - "build": "polkadot-dev-build-ts && yarn run build:methodsdoc && polkadot-dev-build-docs", + "build": "plugnet-dev-build-ts && yarn run build:methodsdoc", "build:htmldoc": "yarn clean && typedoc --theme default --out docs/html", "build:methodsdoc": "node packages/types/src/scripts/MetadataMdWrapper.js", "check": "yarn lint", "lint": "tslint --project . && tsc --noEmit --pretty", - "clean": "polkadot-dev-clean-build", - "postinstall": "polkadot-dev-yarn-only", + "clean": "plugnet-dev-clean-build", + "postinstall": "plugnet-dev-yarn-only", "test": "jest --coverage" }, "devDependencies": { "@babel/core": "^7.4.3", "@babel/register": "^7.4.0", "@babel/runtime": "^7.4.3", - "@polkadot/dev": "^0.30.0-beta.1", + "@plugnet/dev": "^0.30.1", "@polkadot/ts": "^0.1.56", "gh-pages": "^2.0.1" } diff --git a/packages/api/test/e2e/promise-tx.spec.js b/packages/api/test/e2e/promise-tx.spec.js index f68b14ab74..de1ff22fd5 100644 --- a/packages/api/test/e2e/promise-tx.spec.js +++ b/packages/api/test/e2e/promise-tx.spec.js @@ -10,7 +10,7 @@ import Api from '../../src/promise'; import WsProvider from '../../../rpc-provider/src/ws'; import SingleAccountSigner from "../util/SingleAccountSigner"; -describe('e2e transactions', () => { +describe.skip('e2e transactions', () => { const keyring = testingPairs({ type: 'ed25519' }); let api; diff --git a/packages/types/src/Metadata/v0/Storage.ts b/packages/types/src/Metadata/v0/Storage.ts index e0803942cc..e588f578af 100644 --- a/packages/types/src/Metadata/v0/Storage.ts +++ b/packages/types/src/Metadata/v0/Storage.ts @@ -11,6 +11,7 @@ import Vector from '../../codec/Vector'; import Bytes from '../../primitive/Bytes'; import Text from '../../primitive/Text'; import Type from '../../primitive/Type'; +import { DoubleMapType } from '../v4/Storage'; export class StorageFunctionModifier extends Enum { constructor (value?: any) { @@ -69,14 +70,22 @@ export class MapType extends Struct { export class PlainType extends Type { } -export class StorageFunctionType extends EnumType { +export class StorageFunctionType extends EnumType { constructor (value?: any, index?: number) { super({ PlainType, - MapType + MapType, + DoubleMapType }, value, index); } + /** + * @description `true` if the storage entry is a doublemap + */ + get isDoubleMap (): boolean { + return this.toNumber() === 2; + } + /** * @description `true` if the storage entry is a map */ @@ -84,6 +93,13 @@ export class StorageFunctionType extends EnumType { return this.toNumber() === 1; } + /** + * @description The value as a double mapped value + */ + get asDoubleMap (): DoubleMapType { + return this.value as DoubleMapType; + } + /** * @description The value as a mapped value */ @@ -102,6 +118,10 @@ export class StorageFunctionType extends EnumType { * @description Returns the string representation of the value */ toString (): string { + if (this.isDoubleMap) { + return this.asDoubleMap.value.toString(); + } + if (this.isMap) { if (this.asMap.isLinked) { return `(${this.asMap.value.toString()}, Linkage<${this.asMap.key.toString()}>)`; diff --git a/packages/types/src/Metadata/v2/Storage.ts b/packages/types/src/Metadata/v2/Storage.ts index 10e02cd37a..d3ef270051 100644 --- a/packages/types/src/Metadata/v2/Storage.ts +++ b/packages/types/src/Metadata/v2/Storage.ts @@ -2,6 +2,8 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +import { DoubleMapType } from './../v4/Storage'; + import { AnyNumber } from '../../types'; import EnumType from '../../codec/EnumType'; @@ -50,14 +52,22 @@ export class MapType extends Struct { } } -export class StorageFunctionType extends EnumType { +export class StorageFunctionType extends EnumType { constructor (value?: any, index?: number) { super({ PlainType, - MapType + MapType, + DoubleMapType }, value, index); } + /** + * @description `true` if the storage entry is a doublemap + */ + get isDoubleMap (): boolean { + return this.toNumber() === 2; + } + /** * @description `true` if the storage entry is a map */ @@ -65,6 +75,13 @@ export class StorageFunctionType extends EnumType { return this.toNumber() === 1; } + /** + * @description The value as a double mapped value + */ + get asDoubleMap (): DoubleMapType { + return this.value as DoubleMapType; + } + /** * @description The value as a mapped value */ @@ -83,6 +100,9 @@ export class StorageFunctionType extends EnumType { * @description Returns the string representation of the value */ toString (): string { + if (this.isDoubleMap) { + return this.asDoubleMap.value.toString(); + } return this.isMap ? this.asMap.value.toString() : this.asType.toString();