Adjust types based on use (#2742)
* Adjust types based on use * MetaRegistry * Remove FIXME * Split path extraction * casing * Rewrite * Rewrite interfaces * Remove unused vuepress
This commit is contained in:
@@ -26,11 +26,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/api": "2.2.2-10",
|
||||
"@polkadot/rpc-core": "2.2.2-10",
|
||||
"@polkadot/types": "2.2.2-10",
|
||||
"@polkadot/util": "^3.6.0-beta.9",
|
||||
"@polkadot/util": "^3.6.0-beta.16",
|
||||
"bn.js": "^5.1.3",
|
||||
"rxjs": "^6.6.3"
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { AnyJson } from '@polkadot/types/types';
|
||||
import { ChainProperties, InkConstructorSpec, InkMessageSpec, InkProject } from '@polkadot/types/interfaces';
|
||||
import { ChainProperties, ContractConstructorSpec, ContractMessageSpec, ContractProject } from '@polkadot/types/interfaces';
|
||||
import { AbiConstructor, AbiMessage, AbiMessageParam } from './types';
|
||||
|
||||
import { assert, isNumber, isObject, isString, stringCamelCase } from '@polkadot/util';
|
||||
@@ -28,7 +28,7 @@ export default class Abi {
|
||||
|
||||
public readonly messages: AbiMessage[];
|
||||
|
||||
public readonly project: InkProject;
|
||||
public readonly project: ContractProject;
|
||||
|
||||
public readonly registry: MetaRegistry;
|
||||
|
||||
@@ -41,17 +41,17 @@ export default class Abi {
|
||||
|
||||
this.json = json;
|
||||
this.registry = new MetaRegistry(chainProperties);
|
||||
this.project = this.registry.createType('InkProject', json);
|
||||
this.project = this.registry.createType('ContractProject', json);
|
||||
|
||||
this.registry.setMetaTypes(this.project.types);
|
||||
|
||||
this.project.types.forEach((_, index) => this.registry.getMetaTypeDef(this.registry.createType('MtLookupTypeId', index + 1)));
|
||||
this.constructors = this.project.spec.constructors.map((spec: InkConstructorSpec, index) =>
|
||||
this.project.types.forEach((_, index) => this.registry.getMetaTypeDef(this.registry.createType('SiLookupTypeId', index + 1)));
|
||||
this.constructors = this.project.spec.constructors.map((spec: ContractConstructorSpec, index) =>
|
||||
this.#createBase(spec, index, {
|
||||
isConstructor: true
|
||||
})
|
||||
);
|
||||
this.messages = this.project.spec.messages.map((spec: InkMessageSpec, index): AbiMessage => {
|
||||
this.messages = this.project.spec.messages.map((spec: ContractMessageSpec, index): AbiMessage => {
|
||||
const typeSpec = spec.returnType.unwrapOr(null);
|
||||
|
||||
return this.#createBase(spec, index, {
|
||||
@@ -72,7 +72,7 @@ export default class Abi {
|
||||
return findMessage(this.messages, messageOrId);
|
||||
}
|
||||
|
||||
#createBase = (spec: InkMessageSpec | InkConstructorSpec, index: number, add: Partial<AbiMessage> = {}): AbiMessage => {
|
||||
#createBase = (spec: ContractMessageSpec | ContractConstructorSpec, index: number, add: Partial<AbiMessage> = {}): AbiMessage => {
|
||||
const identifier = spec.name.toString();
|
||||
const args = spec.args.map((arg, index): AbiMessageParam => {
|
||||
try {
|
||||
|
||||
@@ -1,25 +1,26 @@
|
||||
// Copyright 2017-2020 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { ChainProperties, MtField, MtLookupTypeId, MtType, MtTypeDefArray, MtTypeDefVariant, MtTypeDefSequence, MtTypeDefTuple, MtVariant } from '@polkadot/types/interfaces';
|
||||
import { ChainProperties, SiField, SiLookupTypeId, SiType, SiTypeDefArray, SiTypeDefVariant, SiTypeDefSequence, SiTypeDefTuple, SiVariant } from '@polkadot/types/interfaces';
|
||||
import { InterfaceTypes, TypeDef, TypeDefInfo } from '@polkadot/types/types';
|
||||
|
||||
import { assert, isUndefined } from '@polkadot/util';
|
||||
import { TypeRegistry, withTypeString } from '@polkadot/types';
|
||||
|
||||
// convert the offset into project-specific, index-1
|
||||
export function getRegistryOffset (id: MtLookupTypeId): number {
|
||||
export function getRegistryOffset (id: SiLookupTypeId): number {
|
||||
return id.toNumber() - 1;
|
||||
}
|
||||
|
||||
const PRIMITIVE_ALIAS: Record<string, keyof InterfaceTypes> = {
|
||||
Char: 'u32', // Rust char is 4-bytes
|
||||
Str: 'Text'
|
||||
};
|
||||
|
||||
export default class MetaRegistry extends TypeRegistry {
|
||||
public readonly metaTypeDefs: TypeDef[] = [];
|
||||
|
||||
#metaTypes: MtType[] = [];
|
||||
#siTypes: SiType[] = [];
|
||||
|
||||
constructor (chainProperties?: ChainProperties) {
|
||||
super();
|
||||
@@ -29,11 +30,11 @@ export default class MetaRegistry extends TypeRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
public setMetaTypes (metaTypes: MtType[]): void {
|
||||
this.#metaTypes = metaTypes;
|
||||
public setMetaTypes (metaTypes: SiType[]): void {
|
||||
this.#siTypes = metaTypes;
|
||||
}
|
||||
|
||||
public getMetaTypeDef (id: MtLookupTypeId): TypeDef {
|
||||
public getMetaTypeDef (id: SiLookupTypeId): TypeDef {
|
||||
const offset = getRegistryOffset(id);
|
||||
let typeDef = this.metaTypeDefs[offset];
|
||||
|
||||
@@ -54,19 +55,22 @@ export default class MetaRegistry extends TypeRegistry {
|
||||
return typeDef;
|
||||
}
|
||||
|
||||
#getMetaType = (id: MtLookupTypeId): MtType => {
|
||||
const type = this.#metaTypes[getRegistryOffset(id)];
|
||||
#getMetaType = (id: SiLookupTypeId): SiType => {
|
||||
const type = this.#siTypes[getRegistryOffset(id)];
|
||||
|
||||
assert(!isUndefined(type), `getMetaType:: Unable to find ${id.toNumber()} in type values`);
|
||||
|
||||
return this.createType('MtType', type);
|
||||
return this.createType('SiType', type);
|
||||
}
|
||||
|
||||
#extract = (type: MtType, id: MtLookupTypeId): TypeDef => {
|
||||
#extract = (type: SiType, id: SiLookupTypeId): TypeDef => {
|
||||
const path = [...type.path];
|
||||
let typeDef: Omit<TypeDef, 'type'>;
|
||||
|
||||
if (type.path.join('::').startsWith('ink_env::types::') || type.def.isPrimitive) {
|
||||
// TODO solang?
|
||||
if (type.path.join('::').startsWith('ink_env::types::')) {
|
||||
typeDef = this.#extractPrimitivePath(type);
|
||||
} else if (type.def.isPrimitive) {
|
||||
typeDef = this.#extractPrimitive(type);
|
||||
} else if (type.def.isComposite) {
|
||||
typeDef = this.#extractFields(type.def.asComposite.fields);
|
||||
@@ -101,8 +105,8 @@ export default class MetaRegistry extends TypeRegistry {
|
||||
});
|
||||
}
|
||||
|
||||
#extractArray = ({ len: length, type }: MtTypeDefArray): Omit<TypeDef, 'type'> => {
|
||||
assert(!length || length.toNumber() <= 256, 'ContractRegistry: Only support for [Type; <length>], where length > 256');
|
||||
#extractArray = ({ len: length, type }: SiTypeDefArray): Omit<TypeDef, 'type'> => {
|
||||
assert(!length || length.toNumber() <= 256, 'MetaRegistry: Only support for [Type; <length>], where length > 256');
|
||||
|
||||
return {
|
||||
info: TypeDefInfo.VecFixed,
|
||||
@@ -111,7 +115,7 @@ export default class MetaRegistry extends TypeRegistry {
|
||||
};
|
||||
}
|
||||
|
||||
#extractFields = (fields: MtField[]): Omit<TypeDef, 'type'> => {
|
||||
#extractFields = (fields: SiField[]): Omit<TypeDef, 'type'> => {
|
||||
const [isStruct, isTuple] = fields.reduce(([isAllNamed, isAllUnnamed], { name }) => ([
|
||||
isAllNamed && name.isSome,
|
||||
isAllUnnamed && name.isNone
|
||||
@@ -141,26 +145,23 @@ export default class MetaRegistry extends TypeRegistry {
|
||||
: { info, sub };
|
||||
}
|
||||
|
||||
#extractPrimitive = (type: MtType): TypeDef => {
|
||||
if (type.def.isPrimitive) {
|
||||
const typeStr = type.def.asPrimitive.type.toString();
|
||||
#extractPrimitive = (type: SiType): TypeDef => {
|
||||
const typeStr = type.def.asPrimitive.type.toString();
|
||||
|
||||
return {
|
||||
info: TypeDefInfo.Plain,
|
||||
// FIXME This should not be as a blanket toLowerCase
|
||||
type: PRIMITIVE_ALIAS[typeStr] || typeStr.toLowerCase()
|
||||
};
|
||||
} else if (type.path.length > 1) {
|
||||
return {
|
||||
info: TypeDefInfo.Plain,
|
||||
type: type.path[type.path.length - 1].toString()
|
||||
};
|
||||
}
|
||||
|
||||
throw new Error('Invalid primitive type');
|
||||
return {
|
||||
info: TypeDefInfo.Plain,
|
||||
type: PRIMITIVE_ALIAS[typeStr] || typeStr.toLowerCase()
|
||||
};
|
||||
}
|
||||
|
||||
#extractSequence = ({ type }: MtTypeDefSequence, id: MtLookupTypeId): Omit<TypeDef, 'type'> => {
|
||||
#extractPrimitivePath = (type: SiType): TypeDef => {
|
||||
return {
|
||||
info: TypeDefInfo.Plain,
|
||||
type: type.path[type.path.length - 1].toString()
|
||||
};
|
||||
}
|
||||
|
||||
#extractSequence = ({ type }: SiTypeDefSequence, id: SiLookupTypeId): Omit<TypeDef, 'type'> => {
|
||||
assert(!!type, `ContractRegistry: Invalid sequence type found at id ${id.toString()}`);
|
||||
|
||||
return {
|
||||
@@ -169,7 +170,7 @@ export default class MetaRegistry extends TypeRegistry {
|
||||
};
|
||||
}
|
||||
|
||||
#extractTuple = (ids: MtTypeDefTuple): Omit<TypeDef, 'type'> => {
|
||||
#extractTuple = (ids: SiTypeDefTuple): Omit<TypeDef, 'type'> => {
|
||||
return ids.length === 1
|
||||
? this.getMetaTypeDef(ids[0])
|
||||
: {
|
||||
@@ -178,7 +179,7 @@ export default class MetaRegistry extends TypeRegistry {
|
||||
};
|
||||
}
|
||||
|
||||
#extractVariant = ({ variants }: MtTypeDefVariant, id: MtLookupTypeId): Omit<TypeDef, 'type'> => {
|
||||
#extractVariant = ({ variants }: SiTypeDefVariant, id: SiLookupTypeId): Omit<TypeDef, 'type'> => {
|
||||
const { params, path } = this.#getMetaType(id);
|
||||
const specialVariant = path[0].toString();
|
||||
|
||||
@@ -203,7 +204,7 @@ export default class MetaRegistry extends TypeRegistry {
|
||||
};
|
||||
}
|
||||
|
||||
#extractVariantSub = (variants: MtVariant[]): TypeDef[] => {
|
||||
#extractVariantSub = (variants: SiVariant[]): TypeDef[] => {
|
||||
const isAllUnitVariants = variants.every(({ fields }) => fields.length === 0);
|
||||
|
||||
if (isAllUnitVariants) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { ApiTypes } from '@polkadot/api/types';
|
||||
import { ContractExecResult, InkSelector } from '@polkadot/types/interfaces';
|
||||
import { ContractExecResult, ContractSelector } from '@polkadot/types/interfaces';
|
||||
import { Codec, TypeDef } from '@polkadot/types/types';
|
||||
|
||||
import ApiBase from '@polkadot/api/base';
|
||||
@@ -30,7 +30,7 @@ export interface AbiMessage {
|
||||
isMutating?: boolean;
|
||||
isPayable?: boolean;
|
||||
returnType?: TypeDef | null;
|
||||
selector: InkSelector;
|
||||
selector: ContractSelector;
|
||||
}
|
||||
|
||||
export type AbiConstructor = AbiMessage;
|
||||
|
||||
@@ -35,7 +35,7 @@ export function encodeMessage (registry: Registry, message: AbiMessage | AbiCons
|
||||
r[name] = type.displayName || encodeTypeDef(type);
|
||||
|
||||
return r;
|
||||
}, { __selector: 'InkSelector' })
|
||||
}, { __selector: 'ContractSelector' })
|
||||
));
|
||||
|
||||
return compactAddLength(new Clazz(registry, message.args.reduce((r: Record<string, CodecArg>, { name }, index): Record<string, CodecArg> => {
|
||||
|
||||
@@ -27,18 +27,18 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/api": "2.2.2-10",
|
||||
"@polkadot/rpc-core": "2.2.2-10",
|
||||
"@polkadot/rpc-provider": "2.2.2-10",
|
||||
"@polkadot/types": "2.2.2-10",
|
||||
"@polkadot/util": "^3.6.0-beta.9",
|
||||
"@polkadot/util-crypto": "^3.6.0-beta.9",
|
||||
"@polkadot/util": "^3.6.0-beta.16",
|
||||
"@polkadot/util-crypto": "^3.6.0-beta.16",
|
||||
"bn.js": "^5.1.3",
|
||||
"memoizee": "^0.4.14",
|
||||
"rxjs": "^6.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^3.6.0-beta.9"
|
||||
"@polkadot/keyring": "^3.6.0-beta.16"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,21 +26,21 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/api-derive": "2.2.2-10",
|
||||
"@polkadot/keyring": "^3.6.0-beta.9",
|
||||
"@polkadot/keyring": "^3.6.0-beta.16",
|
||||
"@polkadot/metadata": "2.2.2-10",
|
||||
"@polkadot/rpc-core": "2.2.2-10",
|
||||
"@polkadot/rpc-provider": "2.2.2-10",
|
||||
"@polkadot/types": "2.2.2-10",
|
||||
"@polkadot/types-known": "2.2.2-10",
|
||||
"@polkadot/util": "^3.6.0-beta.9",
|
||||
"@polkadot/util-crypto": "^3.6.0-beta.9",
|
||||
"@polkadot/util": "^3.6.0-beta.16",
|
||||
"@polkadot/util-crypto": "^3.6.0-beta.16",
|
||||
"bn.js": "^5.1.3",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"rxjs": "^6.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^3.6.0-beta.9"
|
||||
"@polkadot/keyring": "^3.6.0-beta.16"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,14 +26,14 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/types": "2.2.2-10",
|
||||
"@polkadot/types-known": "2.2.2-10",
|
||||
"@polkadot/util": "^3.6.0-beta.9",
|
||||
"@polkadot/util-crypto": "^3.6.0-beta.9",
|
||||
"@polkadot/util": "^3.6.0-beta.16",
|
||||
"@polkadot/util-crypto": "^3.6.0-beta.16",
|
||||
"bn.js": "^5.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^3.6.0-beta.9"
|
||||
"@polkadot/keyring": "^3.6.0-beta.16"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,15 +26,15 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/metadata": "2.2.2-10",
|
||||
"@polkadot/rpc-provider": "2.2.2-10",
|
||||
"@polkadot/types": "2.2.2-10",
|
||||
"@polkadot/util": "^3.6.0-beta.9",
|
||||
"@polkadot/util": "^3.6.0-beta.16",
|
||||
"memoizee": "^0.4.14",
|
||||
"rxjs": "^6.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^3.6.0-beta.9"
|
||||
"@polkadot/keyring": "^3.6.0-beta.16"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,18 +26,18 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/metadata": "2.2.2-10",
|
||||
"@polkadot/types": "2.2.2-10",
|
||||
"@polkadot/util": "^3.6.0-beta.9",
|
||||
"@polkadot/util-crypto": "^3.6.0-beta.9",
|
||||
"@polkadot/x-fetch": "^0.3.2",
|
||||
"@polkadot/x-ws": "^0.3.2",
|
||||
"@polkadot/util": "^3.6.0-beta.16",
|
||||
"@polkadot/util-crypto": "^3.6.0-beta.16",
|
||||
"@polkadot/x-fetch": "^0.3.3",
|
||||
"@polkadot/x-ws": "^0.3.3",
|
||||
"bn.js": "^5.1.3",
|
||||
"eventemitter3": "^4.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^3.6.0-beta.9",
|
||||
"@polkadot/keyring": "^3.6.0-beta.16",
|
||||
"mock-socket": "^9.0.3",
|
||||
"nock": "^13.0.4"
|
||||
}
|
||||
|
||||
@@ -33,20 +33,20 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/typegen#readme",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.11.6",
|
||||
"@babel/register": "^7.11.5",
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@babel/core": "^7.12.3",
|
||||
"@babel/register": "^7.12.1",
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/api": "2.2.2-10",
|
||||
"@polkadot/metadata": "2.2.2-10",
|
||||
"@polkadot/rpc-provider": "2.2.2-10",
|
||||
"@polkadot/types": "2.2.2-10",
|
||||
"@polkadot/util": "^3.6.0-beta.9",
|
||||
"@polkadot/util": "^3.6.0-beta.16",
|
||||
"handlebars": "^4.7.6",
|
||||
"websocket": "^1.0.32",
|
||||
"yargs": "^16.0.3"
|
||||
"yargs": "^16.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/websocket": "^1.0.1",
|
||||
"@types/yargs": "^15.0.7"
|
||||
"@types/yargs": "^15.0.9"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/types": "2.2.2-10",
|
||||
"@polkadot/util": "^3.6.0-beta.9",
|
||||
"@polkadot/util": "^3.6.0-beta.16",
|
||||
"bn.js": "^5.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -26,17 +26,17 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/metadata": "2.2.2-10",
|
||||
"@polkadot/util": "^3.6.0-beta.9",
|
||||
"@polkadot/util-crypto": "^3.6.0-beta.9",
|
||||
"@polkadot/util": "^3.6.0-beta.16",
|
||||
"@polkadot/util-crypto": "^3.6.0-beta.16",
|
||||
"@types/bn.js": "^4.11.6",
|
||||
"bn.js": "^5.1.3",
|
||||
"memoizee": "^0.4.14",
|
||||
"rxjs": "^6.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^3.6.0-beta.9",
|
||||
"@polkadot/keyring": "^3.6.0-beta.16",
|
||||
"@types/memoizee": "^0.4.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claim
|
||||
import { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
|
||||
import { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
|
||||
import { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultSuccess, ContractExecResultSuccessTo255, ContractExecResultTo255, ContractInfo, ContractStorageKey, Gas, HostFnWeights, InstructionWeights, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
|
||||
import { InkConstructorSpec, InkContractSpec, InkCryptoHasher, InkDiscriminant, InkDisplayName, InkEventParamSpec, InkEventSpec, InkLayoutArray, InkLayoutCell, InkLayoutEnum, InkLayoutHash, InkLayoutHashingStrategy, InkLayoutKey, InkLayoutStruct, InkLayoutStructField, InkMessageParamSpec, InkMessageSpec, InkProject, InkProjectContract, InkProjectSource, InkSelector, InkStorageLayout, InkTypeSpec, MtField, MtLookupTypeId, MtPath, MtType, MtTypeDef, MtTypeDefArray, MtTypeDefComposite, MtTypeDefPrimitive, MtTypeDefSequence, MtTypeDefTuple, MtTypeDefVariant, MtVariant } from '@polkadot/types/interfaces/contractsAbi';
|
||||
import { ContractConstructorSpec, ContractContractSpec, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpec, ContractEventSpec, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpec, ContractMessageSpec, ContractProject, ContractProjectContract, ContractProjectSource, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
|
||||
import { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
|
||||
import { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
|
||||
import { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine';
|
||||
@@ -37,6 +37,7 @@ import { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purch
|
||||
import { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
|
||||
import { RpcMethods } from '@polkadot/types/interfaces/rpc';
|
||||
import { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, Consensus, ConsensusEngineId, Digest, DigestItem, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, GenericAddress, H160, H256, H512, Hash, Header, I32F32, Index, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, OpaqueCall, Origin, OriginCaller, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, StorageData, TransactionPriority, U32F32, ValidatorId, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
|
||||
import { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo';
|
||||
import { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler';
|
||||
import { FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, ValidatorCount } from '@polkadot/types/interfaces/session';
|
||||
import { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
|
||||
@@ -529,113 +530,6 @@ declare module '@polkadot/types/types/registry' {
|
||||
TrieId: TrieId;
|
||||
'Option<TrieId>': Option<TrieId>;
|
||||
'Vec<TrieId>': Vec<TrieId>;
|
||||
InkCryptoHasher: InkCryptoHasher;
|
||||
'Option<InkCryptoHasher>': Option<InkCryptoHasher>;
|
||||
'Vec<InkCryptoHasher>': Vec<InkCryptoHasher>;
|
||||
InkDiscriminant: InkDiscriminant;
|
||||
'Compact<InkDiscriminant>': Compact<InkDiscriminant>;
|
||||
'Option<InkDiscriminant>': Option<InkDiscriminant>;
|
||||
'Vec<InkDiscriminant>': Vec<InkDiscriminant>;
|
||||
InkLayoutArray: InkLayoutArray;
|
||||
'Option<InkLayoutArray>': Option<InkLayoutArray>;
|
||||
'Vec<InkLayoutArray>': Vec<InkLayoutArray>;
|
||||
InkLayoutCell: InkLayoutCell;
|
||||
'Option<InkLayoutCell>': Option<InkLayoutCell>;
|
||||
'Vec<InkLayoutCell>': Vec<InkLayoutCell>;
|
||||
InkLayoutEnum: InkLayoutEnum;
|
||||
'Option<InkLayoutEnum>': Option<InkLayoutEnum>;
|
||||
'Vec<InkLayoutEnum>': Vec<InkLayoutEnum>;
|
||||
InkLayoutHash: InkLayoutHash;
|
||||
'Option<InkLayoutHash>': Option<InkLayoutHash>;
|
||||
'Vec<InkLayoutHash>': Vec<InkLayoutHash>;
|
||||
InkLayoutHashingStrategy: InkLayoutHashingStrategy;
|
||||
'Option<InkLayoutHashingStrategy>': Option<InkLayoutHashingStrategy>;
|
||||
'Vec<InkLayoutHashingStrategy>': Vec<InkLayoutHashingStrategy>;
|
||||
InkLayoutKey: InkLayoutKey;
|
||||
'Option<InkLayoutKey>': Option<InkLayoutKey>;
|
||||
'Vec<InkLayoutKey>': Vec<InkLayoutKey>;
|
||||
InkLayoutStruct: InkLayoutStruct;
|
||||
'Option<InkLayoutStruct>': Option<InkLayoutStruct>;
|
||||
'Vec<InkLayoutStruct>': Vec<InkLayoutStruct>;
|
||||
InkLayoutStructField: InkLayoutStructField;
|
||||
'Option<InkLayoutStructField>': Option<InkLayoutStructField>;
|
||||
'Vec<InkLayoutStructField>': Vec<InkLayoutStructField>;
|
||||
InkStorageLayout: InkStorageLayout;
|
||||
'Option<InkStorageLayout>': Option<InkStorageLayout>;
|
||||
'Vec<InkStorageLayout>': Vec<InkStorageLayout>;
|
||||
MtField: MtField;
|
||||
'Option<MtField>': Option<MtField>;
|
||||
'Vec<MtField>': Vec<MtField>;
|
||||
MtLookupTypeId: MtLookupTypeId;
|
||||
'Compact<MtLookupTypeId>': Compact<MtLookupTypeId>;
|
||||
'Option<MtLookupTypeId>': Option<MtLookupTypeId>;
|
||||
'Vec<MtLookupTypeId>': Vec<MtLookupTypeId>;
|
||||
MtPath: MtPath;
|
||||
'Option<MtPath>': Option<MtPath>;
|
||||
'Vec<MtPath>': Vec<MtPath>;
|
||||
MtType: MtType;
|
||||
'Option<MtType>': Option<MtType>;
|
||||
'Vec<MtType>': Vec<MtType>;
|
||||
MtTypeDef: MtTypeDef;
|
||||
'Option<MtTypeDef>': Option<MtTypeDef>;
|
||||
'Vec<MtTypeDef>': Vec<MtTypeDef>;
|
||||
MtTypeDefArray: MtTypeDefArray;
|
||||
'Option<MtTypeDefArray>': Option<MtTypeDefArray>;
|
||||
'Vec<MtTypeDefArray>': Vec<MtTypeDefArray>;
|
||||
MtTypeDefComposite: MtTypeDefComposite;
|
||||
'Option<MtTypeDefComposite>': Option<MtTypeDefComposite>;
|
||||
'Vec<MtTypeDefComposite>': Vec<MtTypeDefComposite>;
|
||||
MtTypeDefVariant: MtTypeDefVariant;
|
||||
'Option<MtTypeDefVariant>': Option<MtTypeDefVariant>;
|
||||
'Vec<MtTypeDefVariant>': Vec<MtTypeDefVariant>;
|
||||
MtTypeDefPrimitive: MtTypeDefPrimitive;
|
||||
'Option<MtTypeDefPrimitive>': Option<MtTypeDefPrimitive>;
|
||||
'Vec<MtTypeDefPrimitive>': Vec<MtTypeDefPrimitive>;
|
||||
MtTypeDefSequence: MtTypeDefSequence;
|
||||
'Option<MtTypeDefSequence>': Option<MtTypeDefSequence>;
|
||||
'Vec<MtTypeDefSequence>': Vec<MtTypeDefSequence>;
|
||||
MtTypeDefTuple: MtTypeDefTuple;
|
||||
'Option<MtTypeDefTuple>': Option<MtTypeDefTuple>;
|
||||
'Vec<MtTypeDefTuple>': Vec<MtTypeDefTuple>;
|
||||
MtVariant: MtVariant;
|
||||
'Option<MtVariant>': Option<MtVariant>;
|
||||
'Vec<MtVariant>': Vec<MtVariant>;
|
||||
InkConstructorSpec: InkConstructorSpec;
|
||||
'Option<InkConstructorSpec>': Option<InkConstructorSpec>;
|
||||
'Vec<InkConstructorSpec>': Vec<InkConstructorSpec>;
|
||||
InkContractSpec: InkContractSpec;
|
||||
'Option<InkContractSpec>': Option<InkContractSpec>;
|
||||
'Vec<InkContractSpec>': Vec<InkContractSpec>;
|
||||
InkDisplayName: InkDisplayName;
|
||||
'Option<InkDisplayName>': Option<InkDisplayName>;
|
||||
'Vec<InkDisplayName>': Vec<InkDisplayName>;
|
||||
InkEventParamSpec: InkEventParamSpec;
|
||||
'Option<InkEventParamSpec>': Option<InkEventParamSpec>;
|
||||
'Vec<InkEventParamSpec>': Vec<InkEventParamSpec>;
|
||||
InkEventSpec: InkEventSpec;
|
||||
'Option<InkEventSpec>': Option<InkEventSpec>;
|
||||
'Vec<InkEventSpec>': Vec<InkEventSpec>;
|
||||
InkMessageParamSpec: InkMessageParamSpec;
|
||||
'Option<InkMessageParamSpec>': Option<InkMessageParamSpec>;
|
||||
'Vec<InkMessageParamSpec>': Vec<InkMessageParamSpec>;
|
||||
InkMessageSpec: InkMessageSpec;
|
||||
'Option<InkMessageSpec>': Option<InkMessageSpec>;
|
||||
'Vec<InkMessageSpec>': Vec<InkMessageSpec>;
|
||||
InkSelector: InkSelector;
|
||||
'Option<InkSelector>': Option<InkSelector>;
|
||||
'Vec<InkSelector>': Vec<InkSelector>;
|
||||
InkTypeSpec: InkTypeSpec;
|
||||
'Option<InkTypeSpec>': Option<InkTypeSpec>;
|
||||
'Vec<InkTypeSpec>': Vec<InkTypeSpec>;
|
||||
InkProject: InkProject;
|
||||
'Option<InkProject>': Option<InkProject>;
|
||||
'Vec<InkProject>': Vec<InkProject>;
|
||||
InkProjectContract: InkProjectContract;
|
||||
'Option<InkProjectContract>': Option<InkProjectContract>;
|
||||
'Vec<InkProjectContract>': Vec<InkProjectContract>;
|
||||
InkProjectSource: InkProjectSource;
|
||||
'Option<InkProjectSource>': Option<InkProjectSource>;
|
||||
'Vec<InkProjectSource>': Vec<InkProjectSource>;
|
||||
AccountVote: AccountVote;
|
||||
'Option<AccountVote>': Option<AccountVote>;
|
||||
'Vec<AccountVote>': Vec<AccountVote>;
|
||||
@@ -1503,6 +1397,113 @@ declare module '@polkadot/types/types/registry' {
|
||||
AccountValidity: AccountValidity;
|
||||
'Option<AccountValidity>': Option<AccountValidity>;
|
||||
'Vec<AccountValidity>': Vec<AccountValidity>;
|
||||
ContractCryptoHasher: ContractCryptoHasher;
|
||||
'Option<ContractCryptoHasher>': Option<ContractCryptoHasher>;
|
||||
'Vec<ContractCryptoHasher>': Vec<ContractCryptoHasher>;
|
||||
ContractDiscriminant: ContractDiscriminant;
|
||||
'Compact<ContractDiscriminant>': Compact<ContractDiscriminant>;
|
||||
'Option<ContractDiscriminant>': Option<ContractDiscriminant>;
|
||||
'Vec<ContractDiscriminant>': Vec<ContractDiscriminant>;
|
||||
ContractLayoutArray: ContractLayoutArray;
|
||||
'Option<ContractLayoutArray>': Option<ContractLayoutArray>;
|
||||
'Vec<ContractLayoutArray>': Vec<ContractLayoutArray>;
|
||||
ContractLayoutCell: ContractLayoutCell;
|
||||
'Option<ContractLayoutCell>': Option<ContractLayoutCell>;
|
||||
'Vec<ContractLayoutCell>': Vec<ContractLayoutCell>;
|
||||
ContractLayoutEnum: ContractLayoutEnum;
|
||||
'Option<ContractLayoutEnum>': Option<ContractLayoutEnum>;
|
||||
'Vec<ContractLayoutEnum>': Vec<ContractLayoutEnum>;
|
||||
ContractLayoutHash: ContractLayoutHash;
|
||||
'Option<ContractLayoutHash>': Option<ContractLayoutHash>;
|
||||
'Vec<ContractLayoutHash>': Vec<ContractLayoutHash>;
|
||||
ContractLayoutHashingStrategy: ContractLayoutHashingStrategy;
|
||||
'Option<ContractLayoutHashingStrategy>': Option<ContractLayoutHashingStrategy>;
|
||||
'Vec<ContractLayoutHashingStrategy>': Vec<ContractLayoutHashingStrategy>;
|
||||
ContractLayoutKey: ContractLayoutKey;
|
||||
'Option<ContractLayoutKey>': Option<ContractLayoutKey>;
|
||||
'Vec<ContractLayoutKey>': Vec<ContractLayoutKey>;
|
||||
ContractLayoutStruct: ContractLayoutStruct;
|
||||
'Option<ContractLayoutStruct>': Option<ContractLayoutStruct>;
|
||||
'Vec<ContractLayoutStruct>': Vec<ContractLayoutStruct>;
|
||||
ContractLayoutStructField: ContractLayoutStructField;
|
||||
'Option<ContractLayoutStructField>': Option<ContractLayoutStructField>;
|
||||
'Vec<ContractLayoutStructField>': Vec<ContractLayoutStructField>;
|
||||
ContractStorageLayout: ContractStorageLayout;
|
||||
'Option<ContractStorageLayout>': Option<ContractStorageLayout>;
|
||||
'Vec<ContractStorageLayout>': Vec<ContractStorageLayout>;
|
||||
ContractConstructorSpec: ContractConstructorSpec;
|
||||
'Option<ContractConstructorSpec>': Option<ContractConstructorSpec>;
|
||||
'Vec<ContractConstructorSpec>': Vec<ContractConstructorSpec>;
|
||||
ContractContractSpec: ContractContractSpec;
|
||||
'Option<ContractContractSpec>': Option<ContractContractSpec>;
|
||||
'Vec<ContractContractSpec>': Vec<ContractContractSpec>;
|
||||
ContractDisplayName: ContractDisplayName;
|
||||
'Option<ContractDisplayName>': Option<ContractDisplayName>;
|
||||
'Vec<ContractDisplayName>': Vec<ContractDisplayName>;
|
||||
ContractEventParamSpec: ContractEventParamSpec;
|
||||
'Option<ContractEventParamSpec>': Option<ContractEventParamSpec>;
|
||||
'Vec<ContractEventParamSpec>': Vec<ContractEventParamSpec>;
|
||||
ContractEventSpec: ContractEventSpec;
|
||||
'Option<ContractEventSpec>': Option<ContractEventSpec>;
|
||||
'Vec<ContractEventSpec>': Vec<ContractEventSpec>;
|
||||
ContractMessageParamSpec: ContractMessageParamSpec;
|
||||
'Option<ContractMessageParamSpec>': Option<ContractMessageParamSpec>;
|
||||
'Vec<ContractMessageParamSpec>': Vec<ContractMessageParamSpec>;
|
||||
ContractMessageSpec: ContractMessageSpec;
|
||||
'Option<ContractMessageSpec>': Option<ContractMessageSpec>;
|
||||
'Vec<ContractMessageSpec>': Vec<ContractMessageSpec>;
|
||||
ContractSelector: ContractSelector;
|
||||
'Option<ContractSelector>': Option<ContractSelector>;
|
||||
'Vec<ContractSelector>': Vec<ContractSelector>;
|
||||
ContractTypeSpec: ContractTypeSpec;
|
||||
'Option<ContractTypeSpec>': Option<ContractTypeSpec>;
|
||||
'Vec<ContractTypeSpec>': Vec<ContractTypeSpec>;
|
||||
ContractProject: ContractProject;
|
||||
'Option<ContractProject>': Option<ContractProject>;
|
||||
'Vec<ContractProject>': Vec<ContractProject>;
|
||||
ContractProjectContract: ContractProjectContract;
|
||||
'Option<ContractProjectContract>': Option<ContractProjectContract>;
|
||||
'Vec<ContractProjectContract>': Vec<ContractProjectContract>;
|
||||
ContractProjectSource: ContractProjectSource;
|
||||
'Option<ContractProjectSource>': Option<ContractProjectSource>;
|
||||
'Vec<ContractProjectSource>': Vec<ContractProjectSource>;
|
||||
SiField: SiField;
|
||||
'Option<SiField>': Option<SiField>;
|
||||
'Vec<SiField>': Vec<SiField>;
|
||||
SiLookupTypeId: SiLookupTypeId;
|
||||
'Compact<SiLookupTypeId>': Compact<SiLookupTypeId>;
|
||||
'Option<SiLookupTypeId>': Option<SiLookupTypeId>;
|
||||
'Vec<SiLookupTypeId>': Vec<SiLookupTypeId>;
|
||||
SiPath: SiPath;
|
||||
'Option<SiPath>': Option<SiPath>;
|
||||
'Vec<SiPath>': Vec<SiPath>;
|
||||
SiType: SiType;
|
||||
'Option<SiType>': Option<SiType>;
|
||||
'Vec<SiType>': Vec<SiType>;
|
||||
SiTypeDef: SiTypeDef;
|
||||
'Option<SiTypeDef>': Option<SiTypeDef>;
|
||||
'Vec<SiTypeDef>': Vec<SiTypeDef>;
|
||||
SiTypeDefArray: SiTypeDefArray;
|
||||
'Option<SiTypeDefArray>': Option<SiTypeDefArray>;
|
||||
'Vec<SiTypeDefArray>': Vec<SiTypeDefArray>;
|
||||
SiTypeDefComposite: SiTypeDefComposite;
|
||||
'Option<SiTypeDefComposite>': Option<SiTypeDefComposite>;
|
||||
'Vec<SiTypeDefComposite>': Vec<SiTypeDefComposite>;
|
||||
SiTypeDefVariant: SiTypeDefVariant;
|
||||
'Option<SiTypeDefVariant>': Option<SiTypeDefVariant>;
|
||||
'Vec<SiTypeDefVariant>': Vec<SiTypeDefVariant>;
|
||||
SiTypeDefPrimitive: SiTypeDefPrimitive;
|
||||
'Option<SiTypeDefPrimitive>': Option<SiTypeDefPrimitive>;
|
||||
'Vec<SiTypeDefPrimitive>': Vec<SiTypeDefPrimitive>;
|
||||
SiTypeDefSequence: SiTypeDefSequence;
|
||||
'Option<SiTypeDefSequence>': Option<SiTypeDefSequence>;
|
||||
'Vec<SiTypeDefSequence>': Vec<SiTypeDefSequence>;
|
||||
SiTypeDefTuple: SiTypeDefTuple;
|
||||
'Option<SiTypeDefTuple>': Option<SiTypeDefTuple>;
|
||||
'Vec<SiTypeDefTuple>': Vec<SiTypeDefTuple>;
|
||||
SiVariant: SiVariant;
|
||||
'Option<SiVariant>': Option<SiVariant>;
|
||||
'Vec<SiVariant>': Vec<SiVariant>;
|
||||
EthereumAccountId: EthereumAccountId;
|
||||
'Option<EthereumAccountId>': Option<EthereumAccountId>;
|
||||
'Vec<EthereumAccountId>': Vec<EthereumAccountId>;
|
||||
|
||||
@@ -7,142 +7,95 @@ import { Definitions } from '../../types';
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
const layout = {
|
||||
InkCryptoHasher: {
|
||||
ContractCryptoHasher: {
|
||||
_enum: ['Blake2x256', 'Sha2x256', 'Keccak256']
|
||||
},
|
||||
InkDiscriminant: 'u32',
|
||||
InkLayoutArray: {
|
||||
offset: 'InkLayoutKey',
|
||||
ContractDiscriminant: 'u32',
|
||||
ContractLayoutArray: {
|
||||
offset: 'ContractLayoutKey',
|
||||
len: 'u32',
|
||||
cellsPerElem: 'u64',
|
||||
layout: 'InkStorageLayout'
|
||||
layout: 'ContractStorageLayout'
|
||||
},
|
||||
InkLayoutCell: {
|
||||
key: 'InkLayoutKey',
|
||||
ty: 'MtLookupTypeId'
|
||||
ContractLayoutCell: {
|
||||
key: 'ContractLayoutKey',
|
||||
ty: 'SiLookupTypeId'
|
||||
},
|
||||
InkLayoutEnum: {
|
||||
dispatchKey: 'InkLayoutKey',
|
||||
variants: 'BTreeMap<InkDiscriminant, InkLayoutStruct>'
|
||||
ContractLayoutEnum: {
|
||||
dispatchKey: 'ContractLayoutKey',
|
||||
variants: 'BTreeMap<ContractDiscriminant, ContractLayoutStruct>'
|
||||
},
|
||||
InkLayoutHash: {
|
||||
offset: 'InkLayoutKey',
|
||||
strategy: 'InkLayoutHashingStrategy',
|
||||
layout: 'InkStorageLayout'
|
||||
ContractLayoutHash: {
|
||||
offset: 'ContractLayoutKey',
|
||||
strategy: 'ContractLayoutHashingStrategy',
|
||||
layout: 'ContractStorageLayout'
|
||||
},
|
||||
InkLayoutHashingStrategy: {
|
||||
hasher: 'InkCryptoHasher',
|
||||
ContractLayoutHashingStrategy: {
|
||||
hasher: 'ContractCryptoHasher',
|
||||
postfix: 'Vec<u8>',
|
||||
prefix: 'Vec<u8>'
|
||||
},
|
||||
InkLayoutKey: '[u8; 32]',
|
||||
InkLayoutStruct: {
|
||||
fields: 'Vec<InkLayoutStructField>'
|
||||
ContractLayoutKey: '[u8; 32]',
|
||||
ContractLayoutStruct: {
|
||||
fields: 'Vec<ContractLayoutStructField>'
|
||||
},
|
||||
InkLayoutStructField: {
|
||||
layout: 'InkStorageLayout',
|
||||
ContractLayoutStructField: {
|
||||
layout: 'ContractStorageLayout',
|
||||
name: 'Text'
|
||||
},
|
||||
InkStorageLayout: {
|
||||
ContractStorageLayout: {
|
||||
_enum: {
|
||||
Cell: 'InkLayoutCell',
|
||||
Hash: 'InkLayoutHash',
|
||||
Array: 'InkLayoutArray',
|
||||
Struct: 'InkLayoutStruct',
|
||||
Enum: 'InkLayoutEnum'
|
||||
Cell: 'ContractLayoutCell',
|
||||
Hash: 'ContractLayoutHash',
|
||||
Array: 'ContractLayoutArray',
|
||||
Struct: 'ContractLayoutStruct',
|
||||
Enum: 'ContractLayoutEnum'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const spec = {
|
||||
InkConstructorSpec: {
|
||||
ContractConstructorSpec: {
|
||||
name: 'Text',
|
||||
selector: 'InkSelector',
|
||||
args: 'Vec<InkMessageParamSpec>',
|
||||
selector: 'ContractSelector',
|
||||
args: 'Vec<ContractMessageParamSpec>',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
InkContractSpec: {
|
||||
constructors: 'Vec<InkConstructorSpec>',
|
||||
messages: 'Vec<InkMessageSpec>',
|
||||
events: 'Vec<InkEventSpec>',
|
||||
ContractContractSpec: {
|
||||
constructors: 'Vec<ContractConstructorSpec>',
|
||||
messages: 'Vec<ContractMessageSpec>',
|
||||
events: 'Vec<ContractEventSpec>',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
InkDisplayName: 'MtPath',
|
||||
InkEventParamSpec: {
|
||||
ContractDisplayName: 'SiPath',
|
||||
ContractEventParamSpec: {
|
||||
name: 'Text',
|
||||
indexed: 'bool',
|
||||
type: 'InkTypeSpec',
|
||||
type: 'ContractTypeSpec',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
InkEventSpec: {
|
||||
ContractEventSpec: {
|
||||
name: 'Text',
|
||||
args: 'Vec<InkEventParamSpec>',
|
||||
args: 'Vec<ContractEventParamSpec>',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
InkMessageParamSpec: {
|
||||
ContractMessageParamSpec: {
|
||||
name: 'Text',
|
||||
type: 'InkTypeSpec'
|
||||
type: 'ContractTypeSpec'
|
||||
},
|
||||
InkMessageSpec: {
|
||||
ContractMessageSpec: {
|
||||
name: 'Text',
|
||||
selector: 'InkSelector',
|
||||
selector: 'ContractSelector',
|
||||
mutates: 'bool',
|
||||
payable: 'bool',
|
||||
args: 'Vec<InkMessageParamSpec>',
|
||||
returnType: 'Option<InkTypeSpec>',
|
||||
args: 'Vec<ContractMessageParamSpec>',
|
||||
returnType: 'Option<ContractTypeSpec>',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
InkSelector: '[u8; 4]',
|
||||
InkTypeSpec: {
|
||||
type: 'MtLookupTypeId',
|
||||
displayName: 'InkDisplayName'
|
||||
}
|
||||
};
|
||||
|
||||
const registry = {
|
||||
MtField: {
|
||||
name: 'Option<Text>',
|
||||
type: 'MtLookupTypeId'
|
||||
},
|
||||
MtLookupTypeId: 'u32',
|
||||
MtPath: 'Vec<Text>',
|
||||
MtType: {
|
||||
path: 'MtPath',
|
||||
params: 'Vec<MtLookupTypeId>',
|
||||
def: 'MtTypeDef'
|
||||
},
|
||||
MtTypeDef: {
|
||||
_enum: {
|
||||
Composite: 'MtTypeDefComposite',
|
||||
Variant: 'MtTypeDefVariant',
|
||||
Sequence: 'MtTypeDefSequence',
|
||||
Array: 'MtTypeDefArray',
|
||||
Tuple: 'MtTypeDefTuple',
|
||||
Primitive: 'MtTypeDefPrimitive'
|
||||
}
|
||||
},
|
||||
MtTypeDefArray: {
|
||||
len: 'u16',
|
||||
type: 'MtLookupTypeId'
|
||||
},
|
||||
MtTypeDefComposite: {
|
||||
fields: 'Vec<MtField>'
|
||||
},
|
||||
MtTypeDefVariant: {
|
||||
variants: 'Vec<MtVariant>'
|
||||
},
|
||||
MtTypeDefPrimitive: {
|
||||
// this enum definition is mapped in api-contracts/inkTypes.ts
|
||||
_enum: ['Bool', 'Char', 'Str', 'U8', 'U16', 'U32', 'U64', 'U128', 'I8', 'I16', 'I32', 'I64', 'I128']
|
||||
},
|
||||
MtTypeDefSequence: {
|
||||
type: 'MtLookupTypeId'
|
||||
},
|
||||
MtTypeDefTuple: 'Vec<MtLookupTypeId>',
|
||||
MtVariant: {
|
||||
name: 'Text',
|
||||
fields: 'Vec<MtField>',
|
||||
discriminant: 'Option<u64>'
|
||||
ContractSelector: '[u8; 4]',
|
||||
ContractTypeSpec: {
|
||||
type: 'SiLookupTypeId',
|
||||
displayName: 'ContractDisplayName'
|
||||
}
|
||||
};
|
||||
|
||||
@@ -150,20 +103,19 @@ export default {
|
||||
rpc: {},
|
||||
types: {
|
||||
...layout,
|
||||
...registry,
|
||||
...spec,
|
||||
InkProject: {
|
||||
ContractProject: {
|
||||
// added by ABI serialization
|
||||
metadataVersion: 'Text',
|
||||
source: 'InkProjectSource',
|
||||
contract: 'InkProjectContract',
|
||||
source: 'ContractProjectSource',
|
||||
contract: 'ContractProjectContract',
|
||||
// expanded scale registry: RegistryReadOnly
|
||||
types: 'Vec<MtType>',
|
||||
types: 'Vec<SiType>',
|
||||
// renamed from layout (ignored for now, incomplete)
|
||||
// storage: 'InkStorageLayout',
|
||||
spec: 'InkContractSpec'
|
||||
// storage: 'ContractStorageLayout',
|
||||
spec: 'ContractContractSpec'
|
||||
},
|
||||
InkProjectContract: {
|
||||
ContractProjectContract: {
|
||||
name: 'Text',
|
||||
version: 'Text',
|
||||
authors: 'Vec<Text>',
|
||||
@@ -173,7 +125,7 @@ export default {
|
||||
homepage: 'Option<Text>',
|
||||
license: 'Option<Text>'
|
||||
},
|
||||
InkProjectSource: {
|
||||
ContractProjectSource: {
|
||||
hash: '[u8; 32]',
|
||||
language: 'Text',
|
||||
compiler: 'Text'
|
||||
|
||||
@@ -2,128 +2,129 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import { BTreeMap, Enum, Option, Struct, U8aFixed, Vec } from '@polkadot/types/codec';
|
||||
import { Bytes, Text, bool, u16, u32, u64 } from '@polkadot/types/primitive';
|
||||
import { Bytes, Text, bool, u32, u64 } from '@polkadot/types/primitive';
|
||||
import { SiLookupTypeId, SiPath, SiType } from '@polkadot/types/interfaces/scaleInfo';
|
||||
|
||||
/** @name InkConstructorSpec */
|
||||
export interface InkConstructorSpec extends Struct {
|
||||
/** @name ContractConstructorSpec */
|
||||
export interface ContractConstructorSpec extends Struct {
|
||||
readonly name: Text;
|
||||
readonly selector: InkSelector;
|
||||
readonly args: Vec<InkMessageParamSpec>;
|
||||
readonly selector: ContractSelector;
|
||||
readonly args: Vec<ContractMessageParamSpec>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name InkContractSpec */
|
||||
export interface InkContractSpec extends Struct {
|
||||
readonly constructors: Vec<InkConstructorSpec>;
|
||||
readonly messages: Vec<InkMessageSpec>;
|
||||
readonly events: Vec<InkEventSpec>;
|
||||
/** @name ContractContractSpec */
|
||||
export interface ContractContractSpec extends Struct {
|
||||
readonly constructors: Vec<ContractConstructorSpec>;
|
||||
readonly messages: Vec<ContractMessageSpec>;
|
||||
readonly events: Vec<ContractEventSpec>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name InkCryptoHasher */
|
||||
export interface InkCryptoHasher extends Enum {
|
||||
/** @name ContractCryptoHasher */
|
||||
export interface ContractCryptoHasher extends Enum {
|
||||
readonly isBlake2X256: boolean;
|
||||
readonly isSha2X256: boolean;
|
||||
readonly isKeccak256: boolean;
|
||||
}
|
||||
|
||||
/** @name InkDiscriminant */
|
||||
export interface InkDiscriminant extends u32 {}
|
||||
/** @name ContractDiscriminant */
|
||||
export interface ContractDiscriminant extends u32 {}
|
||||
|
||||
/** @name InkDisplayName */
|
||||
export interface InkDisplayName extends MtPath {}
|
||||
/** @name ContractDisplayName */
|
||||
export interface ContractDisplayName extends SiPath {}
|
||||
|
||||
/** @name InkEventParamSpec */
|
||||
export interface InkEventParamSpec extends Struct {
|
||||
/** @name ContractEventParamSpec */
|
||||
export interface ContractEventParamSpec extends Struct {
|
||||
readonly name: Text;
|
||||
readonly indexed: bool;
|
||||
readonly type: InkTypeSpec;
|
||||
readonly type: ContractTypeSpec;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name InkEventSpec */
|
||||
export interface InkEventSpec extends Struct {
|
||||
/** @name ContractEventSpec */
|
||||
export interface ContractEventSpec extends Struct {
|
||||
readonly name: Text;
|
||||
readonly args: Vec<InkEventParamSpec>;
|
||||
readonly args: Vec<ContractEventParamSpec>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name InkLayoutArray */
|
||||
export interface InkLayoutArray extends Struct {
|
||||
readonly offset: InkLayoutKey;
|
||||
/** @name ContractLayoutArray */
|
||||
export interface ContractLayoutArray extends Struct {
|
||||
readonly offset: ContractLayoutKey;
|
||||
readonly len: u32;
|
||||
readonly cellsPerElem: u64;
|
||||
readonly layout: InkStorageLayout;
|
||||
readonly layout: ContractStorageLayout;
|
||||
}
|
||||
|
||||
/** @name InkLayoutCell */
|
||||
export interface InkLayoutCell extends Struct {
|
||||
readonly key: InkLayoutKey;
|
||||
readonly ty: MtLookupTypeId;
|
||||
/** @name ContractLayoutCell */
|
||||
export interface ContractLayoutCell extends Struct {
|
||||
readonly key: ContractLayoutKey;
|
||||
readonly ty: SiLookupTypeId;
|
||||
}
|
||||
|
||||
/** @name InkLayoutEnum */
|
||||
export interface InkLayoutEnum extends Struct {
|
||||
readonly dispatchKey: InkLayoutKey;
|
||||
readonly variants: BTreeMap<InkDiscriminant, InkLayoutStruct>;
|
||||
/** @name ContractLayoutEnum */
|
||||
export interface ContractLayoutEnum extends Struct {
|
||||
readonly dispatchKey: ContractLayoutKey;
|
||||
readonly variants: BTreeMap<ContractDiscriminant, ContractLayoutStruct>;
|
||||
}
|
||||
|
||||
/** @name InkLayoutHash */
|
||||
export interface InkLayoutHash extends Struct {
|
||||
readonly offset: InkLayoutKey;
|
||||
readonly strategy: InkLayoutHashingStrategy;
|
||||
readonly layout: InkStorageLayout;
|
||||
/** @name ContractLayoutHash */
|
||||
export interface ContractLayoutHash extends Struct {
|
||||
readonly offset: ContractLayoutKey;
|
||||
readonly strategy: ContractLayoutHashingStrategy;
|
||||
readonly layout: ContractStorageLayout;
|
||||
}
|
||||
|
||||
/** @name InkLayoutHashingStrategy */
|
||||
export interface InkLayoutHashingStrategy extends Struct {
|
||||
readonly hasher: InkCryptoHasher;
|
||||
/** @name ContractLayoutHashingStrategy */
|
||||
export interface ContractLayoutHashingStrategy extends Struct {
|
||||
readonly hasher: ContractCryptoHasher;
|
||||
readonly postfix: Bytes;
|
||||
readonly prefix: Bytes;
|
||||
}
|
||||
|
||||
/** @name InkLayoutKey */
|
||||
export interface InkLayoutKey extends U8aFixed {}
|
||||
/** @name ContractLayoutKey */
|
||||
export interface ContractLayoutKey extends U8aFixed {}
|
||||
|
||||
/** @name InkLayoutStruct */
|
||||
export interface InkLayoutStruct extends Struct {
|
||||
readonly fields: Vec<InkLayoutStructField>;
|
||||
/** @name ContractLayoutStruct */
|
||||
export interface ContractLayoutStruct extends Struct {
|
||||
readonly fields: Vec<ContractLayoutStructField>;
|
||||
}
|
||||
|
||||
/** @name InkLayoutStructField */
|
||||
export interface InkLayoutStructField extends Struct {
|
||||
readonly layout: InkStorageLayout;
|
||||
/** @name ContractLayoutStructField */
|
||||
export interface ContractLayoutStructField extends Struct {
|
||||
readonly layout: ContractStorageLayout;
|
||||
readonly name: Text;
|
||||
}
|
||||
|
||||
/** @name InkMessageParamSpec */
|
||||
export interface InkMessageParamSpec extends Struct {
|
||||
/** @name ContractMessageParamSpec */
|
||||
export interface ContractMessageParamSpec extends Struct {
|
||||
readonly name: Text;
|
||||
readonly type: InkTypeSpec;
|
||||
readonly type: ContractTypeSpec;
|
||||
}
|
||||
|
||||
/** @name InkMessageSpec */
|
||||
export interface InkMessageSpec extends Struct {
|
||||
/** @name ContractMessageSpec */
|
||||
export interface ContractMessageSpec extends Struct {
|
||||
readonly name: Text;
|
||||
readonly selector: InkSelector;
|
||||
readonly selector: ContractSelector;
|
||||
readonly mutates: bool;
|
||||
readonly payable: bool;
|
||||
readonly args: Vec<InkMessageParamSpec>;
|
||||
readonly returnType: Option<InkTypeSpec>;
|
||||
readonly args: Vec<ContractMessageParamSpec>;
|
||||
readonly returnType: Option<ContractTypeSpec>;
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name InkProject */
|
||||
export interface InkProject extends Struct {
|
||||
/** @name ContractProject */
|
||||
export interface ContractProject extends Struct {
|
||||
readonly metadataVersion: Text;
|
||||
readonly source: InkProjectSource;
|
||||
readonly contract: InkProjectContract;
|
||||
readonly types: Vec<MtType>;
|
||||
readonly spec: InkContractSpec;
|
||||
readonly source: ContractProjectSource;
|
||||
readonly contract: ContractProjectContract;
|
||||
readonly types: Vec<SiType>;
|
||||
readonly spec: ContractContractSpec;
|
||||
}
|
||||
|
||||
/** @name InkProjectContract */
|
||||
export interface InkProjectContract extends Struct {
|
||||
/** @name ContractProjectContract */
|
||||
export interface ContractProjectContract extends Struct {
|
||||
readonly name: Text;
|
||||
readonly version: Text;
|
||||
readonly authors: Vec<Text>;
|
||||
@@ -134,117 +135,34 @@ export interface InkProjectContract extends Struct {
|
||||
readonly license: Option<Text>;
|
||||
}
|
||||
|
||||
/** @name InkProjectSource */
|
||||
export interface InkProjectSource extends Struct {
|
||||
/** @name ContractProjectSource */
|
||||
export interface ContractProjectSource extends Struct {
|
||||
readonly hash: U8aFixed;
|
||||
readonly language: Text;
|
||||
readonly compiler: Text;
|
||||
}
|
||||
|
||||
/** @name InkSelector */
|
||||
export interface InkSelector extends U8aFixed {}
|
||||
/** @name ContractSelector */
|
||||
export interface ContractSelector extends U8aFixed {}
|
||||
|
||||
/** @name InkStorageLayout */
|
||||
export interface InkStorageLayout extends Enum {
|
||||
/** @name ContractStorageLayout */
|
||||
export interface ContractStorageLayout extends Enum {
|
||||
readonly isCell: boolean;
|
||||
readonly asCell: InkLayoutCell;
|
||||
readonly asCell: ContractLayoutCell;
|
||||
readonly isHash: boolean;
|
||||
readonly asHash: InkLayoutHash;
|
||||
readonly asHash: ContractLayoutHash;
|
||||
readonly isArray: boolean;
|
||||
readonly asArray: InkLayoutArray;
|
||||
readonly asArray: ContractLayoutArray;
|
||||
readonly isStruct: boolean;
|
||||
readonly asStruct: InkLayoutStruct;
|
||||
readonly asStruct: ContractLayoutStruct;
|
||||
readonly isEnum: boolean;
|
||||
readonly asEnum: InkLayoutEnum;
|
||||
readonly asEnum: ContractLayoutEnum;
|
||||
}
|
||||
|
||||
/** @name InkTypeSpec */
|
||||
export interface InkTypeSpec extends Struct {
|
||||
readonly type: MtLookupTypeId;
|
||||
readonly displayName: InkDisplayName;
|
||||
}
|
||||
|
||||
/** @name MtField */
|
||||
export interface MtField extends Struct {
|
||||
readonly name: Option<Text>;
|
||||
readonly type: MtLookupTypeId;
|
||||
}
|
||||
|
||||
/** @name MtLookupTypeId */
|
||||
export interface MtLookupTypeId extends u32 {}
|
||||
|
||||
/** @name MtPath */
|
||||
export interface MtPath extends Vec<Text> {}
|
||||
|
||||
/** @name MtType */
|
||||
export interface MtType extends Struct {
|
||||
readonly path: MtPath;
|
||||
readonly params: Vec<MtLookupTypeId>;
|
||||
readonly def: MtTypeDef;
|
||||
}
|
||||
|
||||
/** @name MtTypeDef */
|
||||
export interface MtTypeDef extends Enum {
|
||||
readonly isComposite: boolean;
|
||||
readonly asComposite: MtTypeDefComposite;
|
||||
readonly isVariant: boolean;
|
||||
readonly asVariant: MtTypeDefVariant;
|
||||
readonly isSequence: boolean;
|
||||
readonly asSequence: MtTypeDefSequence;
|
||||
readonly isArray: boolean;
|
||||
readonly asArray: MtTypeDefArray;
|
||||
readonly isTuple: boolean;
|
||||
readonly asTuple: MtTypeDefTuple;
|
||||
readonly isPrimitive: boolean;
|
||||
readonly asPrimitive: MtTypeDefPrimitive;
|
||||
}
|
||||
|
||||
/** @name MtTypeDefArray */
|
||||
export interface MtTypeDefArray extends Struct {
|
||||
readonly len: u16;
|
||||
readonly type: MtLookupTypeId;
|
||||
}
|
||||
|
||||
/** @name MtTypeDefComposite */
|
||||
export interface MtTypeDefComposite extends Struct {
|
||||
readonly fields: Vec<MtField>;
|
||||
}
|
||||
|
||||
/** @name MtTypeDefPrimitive */
|
||||
export interface MtTypeDefPrimitive extends Enum {
|
||||
readonly isBool: boolean;
|
||||
readonly isChar: boolean;
|
||||
readonly isStr: boolean;
|
||||
readonly isU8: boolean;
|
||||
readonly isU16: boolean;
|
||||
readonly isU32: boolean;
|
||||
readonly isU64: boolean;
|
||||
readonly isU128: boolean;
|
||||
readonly isI8: boolean;
|
||||
readonly isI16: boolean;
|
||||
readonly isI32: boolean;
|
||||
readonly isI64: boolean;
|
||||
readonly isI128: boolean;
|
||||
}
|
||||
|
||||
/** @name MtTypeDefSequence */
|
||||
export interface MtTypeDefSequence extends Struct {
|
||||
readonly type: MtLookupTypeId;
|
||||
}
|
||||
|
||||
/** @name MtTypeDefTuple */
|
||||
export interface MtTypeDefTuple extends Vec<MtLookupTypeId> {}
|
||||
|
||||
/** @name MtTypeDefVariant */
|
||||
export interface MtTypeDefVariant extends Struct {
|
||||
readonly variants: Vec<MtVariant>;
|
||||
}
|
||||
|
||||
/** @name MtVariant */
|
||||
export interface MtVariant extends Struct {
|
||||
readonly name: Text;
|
||||
readonly fields: Vec<MtField>;
|
||||
readonly discriminant: Option<u64>;
|
||||
/** @name ContractTypeSpec */
|
||||
export interface ContractTypeSpec extends Struct {
|
||||
readonly type: SiLookupTypeId;
|
||||
readonly displayName: ContractDisplayName;
|
||||
}
|
||||
|
||||
export type PHANTOM_CONTRACTSABI = 'contractsAbi';
|
||||
|
||||
@@ -12,7 +12,6 @@ export { default as balances } from './balances/definitions';
|
||||
export { default as collective } from './collective/definitions';
|
||||
export { default as consensus } from './consensus/definitions';
|
||||
export { default as contracts } from './contracts/definitions';
|
||||
export { default as contractsAbi } from './contractsAbi/definitions';
|
||||
export { default as democracy } from './democracy/definitions';
|
||||
export { default as elections } from './elections/definitions';
|
||||
export { default as engine } from './engine/definitions';
|
||||
@@ -43,6 +42,10 @@ export { default as parachains } from './parachains/definitions';
|
||||
export { default as poll } from './poll/definitions';
|
||||
export { default as purchase } from './purchase/definitions';
|
||||
|
||||
// scale-info & contracts
|
||||
export { default as contractsAbi } from './contractsAbi/definitions';
|
||||
export { default as scaleInfo } from './scaleInfo/definitions';
|
||||
|
||||
// other useful types
|
||||
export { default as ethereum } from './ethereum/definitions';
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
// Copyright 2017-2020 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Definitions } from '../../types';
|
||||
|
||||
// order important in structs... :)
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
export default {
|
||||
rpc: {},
|
||||
types: {
|
||||
SiField: {
|
||||
name: 'Option<Text>',
|
||||
type: 'SiLookupTypeId'
|
||||
},
|
||||
SiLookupTypeId: 'u32',
|
||||
SiPath: 'Vec<Text>',
|
||||
SiType: {
|
||||
path: 'SiPath',
|
||||
params: 'Vec<SiLookupTypeId>',
|
||||
def: 'SiTypeDef'
|
||||
},
|
||||
SiTypeDef: {
|
||||
_enum: {
|
||||
Composite: 'SiTypeDefComposite',
|
||||
Variant: 'SiTypeDefVariant',
|
||||
Sequence: 'SiTypeDefSequence',
|
||||
Array: 'SiTypeDefArray',
|
||||
Tuple: 'SiTypeDefTuple',
|
||||
Primitive: 'SiTypeDefPrimitive'
|
||||
}
|
||||
},
|
||||
SiTypeDefArray: {
|
||||
len: 'u16',
|
||||
type: 'SiLookupTypeId'
|
||||
},
|
||||
SiTypeDefComposite: {
|
||||
fields: 'Vec<SiField>'
|
||||
},
|
||||
SiTypeDefVariant: {
|
||||
variants: 'Vec<SiVariant>'
|
||||
},
|
||||
SiTypeDefPrimitive: {
|
||||
_enum: ['Bool', 'Char', 'Str', 'U8', 'U16', 'U32', 'U64', 'U128', 'I8', 'I16', 'I32', 'I64', 'I128']
|
||||
},
|
||||
SiTypeDefSequence: {
|
||||
type: 'SiLookupTypeId'
|
||||
},
|
||||
SiTypeDefTuple: 'Vec<SiLookupTypeId>',
|
||||
SiVariant: {
|
||||
name: 'Text',
|
||||
fields: 'Vec<SiField>',
|
||||
discriminant: 'Option<u64>'
|
||||
}
|
||||
}
|
||||
} as Definitions;
|
||||
@@ -0,0 +1,4 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
export * from './types';
|
||||
@@ -0,0 +1,90 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import { Enum, Option, Struct, Vec } from '@polkadot/types/codec';
|
||||
import { Text, u16, u32, u64 } from '@polkadot/types/primitive';
|
||||
|
||||
/** @name SiField */
|
||||
export interface SiField extends Struct {
|
||||
readonly name: Option<Text>;
|
||||
readonly type: SiLookupTypeId;
|
||||
}
|
||||
|
||||
/** @name SiLookupTypeId */
|
||||
export interface SiLookupTypeId extends u32 {}
|
||||
|
||||
/** @name SiPath */
|
||||
export interface SiPath extends Vec<Text> {}
|
||||
|
||||
/** @name SiType */
|
||||
export interface SiType extends Struct {
|
||||
readonly path: SiPath;
|
||||
readonly params: Vec<SiLookupTypeId>;
|
||||
readonly def: SiTypeDef;
|
||||
}
|
||||
|
||||
/** @name SiTypeDef */
|
||||
export interface SiTypeDef extends Enum {
|
||||
readonly isComposite: boolean;
|
||||
readonly asComposite: SiTypeDefComposite;
|
||||
readonly isVariant: boolean;
|
||||
readonly asVariant: SiTypeDefVariant;
|
||||
readonly isSequence: boolean;
|
||||
readonly asSequence: SiTypeDefSequence;
|
||||
readonly isArray: boolean;
|
||||
readonly asArray: SiTypeDefArray;
|
||||
readonly isTuple: boolean;
|
||||
readonly asTuple: SiTypeDefTuple;
|
||||
readonly isPrimitive: boolean;
|
||||
readonly asPrimitive: SiTypeDefPrimitive;
|
||||
}
|
||||
|
||||
/** @name SiTypeDefArray */
|
||||
export interface SiTypeDefArray extends Struct {
|
||||
readonly len: u16;
|
||||
readonly type: SiLookupTypeId;
|
||||
}
|
||||
|
||||
/** @name SiTypeDefComposite */
|
||||
export interface SiTypeDefComposite extends Struct {
|
||||
readonly fields: Vec<SiField>;
|
||||
}
|
||||
|
||||
/** @name SiTypeDefPrimitive */
|
||||
export interface SiTypeDefPrimitive extends Enum {
|
||||
readonly isBool: boolean;
|
||||
readonly isChar: boolean;
|
||||
readonly isStr: boolean;
|
||||
readonly isU8: boolean;
|
||||
readonly isU16: boolean;
|
||||
readonly isU32: boolean;
|
||||
readonly isU64: boolean;
|
||||
readonly isU128: boolean;
|
||||
readonly isI8: boolean;
|
||||
readonly isI16: boolean;
|
||||
readonly isI32: boolean;
|
||||
readonly isI64: boolean;
|
||||
readonly isI128: boolean;
|
||||
}
|
||||
|
||||
/** @name SiTypeDefSequence */
|
||||
export interface SiTypeDefSequence extends Struct {
|
||||
readonly type: SiLookupTypeId;
|
||||
}
|
||||
|
||||
/** @name SiTypeDefTuple */
|
||||
export interface SiTypeDefTuple extends Vec<SiLookupTypeId> {}
|
||||
|
||||
/** @name SiTypeDefVariant */
|
||||
export interface SiTypeDefVariant extends Struct {
|
||||
readonly variants: Vec<SiVariant>;
|
||||
}
|
||||
|
||||
/** @name SiVariant */
|
||||
export interface SiVariant extends Struct {
|
||||
readonly name: Text;
|
||||
readonly fields: Vec<SiField>;
|
||||
readonly discriminant: Option<u64>;
|
||||
}
|
||||
|
||||
export type PHANTOM_SCALEINFO = 'scaleInfo';
|
||||
@@ -13,7 +13,7 @@ const ACTUAL = '0x' +
|
||||
// votes 3
|
||||
'3c3a000000b90062690301b9713b004d000000d100d4437d00ef9ad800ca000000fd003ebd4c006c100a00ea00000021009a58de00e3773a00ed0000008c0098bdc200861fc1000a0100005800b2197b00fb721900290100005b00a19ee900c13cdd009001000098005a4c28006d5e670091010000d300b642da002664d800b40100009400ec48b0001c2e1a00cc0100008700492fd4002d3d3700960200003200d5bef600412e4000be0200003c00066689005968d100c6020000f90058a36a00f20cbc00cb02000076006ec96e00472aa30034ac0000000000152502005ed6050034000900ec000000fc0081398300b14adc001a55a2001c0100006a001e4d7e00b33c4f006e3d82007701000031006a48be009d308c00bf3d040081010000ff009151af00925129009151b200a101000087007583760005135d00f6028e00a8010000fe000d209f00295c1800314c2700b801000062006725e4004c73c000c80c4d00d00100000d003e47bb003b444c00be4af2004e0200006e0077651200b9588300ff0cf8005c0200002200ec25f0006e4b4300e652c4008b020000e200832b6300869a5100c408b20093020000c500e1506200fc0f47004e5eb0001803000000c200ff32410040334e003c3353004033b100060000001d00463b43008b1e060155481300bd493b00140100001c002127d400dd4958009f1ab700cd2bfa003b010000b000812e1e008722710040480800962f95008c0100001100b5240201f31634007d3bb50002490500e0010000b6001d102b0096367c007b3ed700514c210018da0000009b00ea397300655744005b2e78005c2654003f0d5c00f80000006200ed26e000b5176b009e14e800a54ae600334f6000300100002500c42fa900c22fac00592c7900c02f88005e2f490048010000f300640cee00cb3b4a000c304b00bf36e1007e3ad3007c010000a300192e5600b42e8100b82e1b00cc2ef5004c2e490006020000dd0097200700a340ab00c46e1600d60c4600eb0af40004fe000000fd00d207f3001f383e00da242400f51dbd00a82b6c00dc36970004910200009500a40cb600ed302700a711d9001e4050000d48f000ba1f9800cd07be000000085900000066005b172f00f01d0e005b172d00dc0f70005a1772005a1786005a178a005a173d005a17ca0059172e003e010000c800020e0c003d223f00302306001d116800931e9600511a1400cc18a1006e0ac700231d05014b02f80000000000001beab9a3ce0000000000000000000000c9d6650d1fd62e310000000000000000c54b85db547a2f52a47bb9a03a091300d4020000';
|
||||
|
||||
describe('CompactAssignmentScaleCompact', (): void => {
|
||||
describe('CompactAssignmentSiCompact', (): void => {
|
||||
// generate_solution_type!(#[compact] pub struct InnerTestSolutionCompact::<_, _, _>(..));
|
||||
// let compact = InnerTestSolution {
|
||||
// votes1: vec![(2, 20), (4, 40)],
|
||||
@@ -99,7 +99,7 @@ describe('CompactAssignmentScaleCompact', (): void => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('CompactAssignmentScaleNormal', (): void => {
|
||||
describe('CompactAssignmentSiNormal', (): void => {
|
||||
// generate_solution_type!(pub struct InnerTestSolutionCompact::<_, _, _>(..));
|
||||
// let compact = InnerTestSolution {
|
||||
// votes1: vec![(2, 20), (4, 40)],
|
||||
|
||||
@@ -9,7 +9,6 @@ export * from './balances/types';
|
||||
export * from './collective/types';
|
||||
export * from './consensus/types';
|
||||
export * from './contracts/types';
|
||||
export * from './contractsAbi/types';
|
||||
export * from './democracy/types';
|
||||
export * from './elections/types';
|
||||
export * from './engine/types';
|
||||
@@ -37,6 +36,8 @@ export * from './claims/types';
|
||||
export * from './parachains/types';
|
||||
export * from './poll/types';
|
||||
export * from './purchase/types';
|
||||
export * from './contractsAbi/types';
|
||||
export * from './scaleInfo/types';
|
||||
export * from './ethereum/types';
|
||||
export * from './metadata/types';
|
||||
export * from './rpc/types';
|
||||
|
||||
Reference in New Issue
Block a user