Compare commits
52 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3f5c65b5d | ||
|
|
7f94137b2d | ||
|
|
d65587f58d | ||
|
|
8959455401 | ||
|
|
8e40e38bd6 | ||
|
|
c646717576 | ||
|
|
4e7d6f03f5 | ||
|
|
cc3f258a5b | ||
|
|
4c776c260d | ||
|
|
f2c636217c | ||
|
|
d7ab3bfbc1 | ||
|
|
567504329d | ||
|
|
5eb3534d8e | ||
|
|
806fda67e9 | ||
|
|
5578d5d0ab | ||
|
|
39c540d453 | ||
|
|
36a244fd75 | ||
|
|
84a0ab816e | ||
|
|
e305f2c11a | ||
|
|
ed773dd158 | ||
|
|
18056a8edd | ||
|
|
96f3ce5b35 | ||
|
|
e7a78ae908 | ||
|
|
295c9219c2 | ||
|
|
99dc85ab4a | ||
|
|
16876cd0a0 | ||
|
|
cb65fb450f | ||
|
|
5bc2ad81f9 | ||
|
|
03b98774bc | ||
|
|
fb49f6bbe9 | ||
|
|
eb792102c8 | ||
|
|
a12a258112 | ||
|
|
018dd8a1c7 | ||
|
|
7a100db4b4 | ||
|
|
858a1d13c4 | ||
|
|
aa1630627a | ||
|
|
c3af40ef50 | ||
|
|
16534d6e5b | ||
|
|
eeb5f766da | ||
|
|
03f41704c4 | ||
|
|
6b0c5fad2d | ||
|
|
51165bf759 | ||
|
|
7f45d995de | ||
|
|
e7b9c40dd9 | ||
|
|
e7b66ceb89 | ||
|
|
d053b86e23 | ||
|
|
6a12aceae2 | ||
|
|
7c6b64c6c8 | ||
|
|
5495501e0c | ||
|
|
6b7824fe4f | ||
|
|
5f0b350a95 | ||
|
|
85269716dd |
10
.123trigger
10
.123trigger
@@ -1,11 +1,14 @@
|
||||
33
|
||||
39
|
||||
|
||||
1.4.2
|
||||
1.6.2
|
||||
1.11.2
|
||||
1.12.2
|
||||
1.17.2
|
||||
1.31.2
|
||||
|
||||
2.8.2
|
||||
|
||||
3.2.2
|
||||
3.2.3
|
||||
3.3.2
|
||||
@@ -17,6 +20,7 @@
|
||||
3.9.2
|
||||
3.9.3
|
||||
3.10.2
|
||||
|
||||
4.0.2
|
||||
4.0.3
|
||||
4.6.2
|
||||
@@ -34,4 +38,6 @@
|
||||
6.0.3
|
||||
6.0.4
|
||||
6.0.5
|
||||
6.1.2
|
||||
6.1.2
|
||||
|
||||
6.4.2
|
||||
33
CHANGELOG.md
33
CHANGELOG.md
@@ -1,8 +1,39 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 6.4.2 Oct 18, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for Westmint runtime 500+
|
||||
|
||||
Changes:
|
||||
|
||||
- Ensure `SignerPayload` correctly serializes `Option` with `None`
|
||||
- Add Ethereum `BlockV{0, 1, 2}` types, aligning with latest Frontier
|
||||
- Additional tests for metadata serialization/de-serialization
|
||||
|
||||
|
||||
## 6.4.1 Oct 17, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for Kusama & Polkadot runtime 9110+
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust Statemint known types for version 4+
|
||||
- Adjust balance derives to return multiple vesting schedules
|
||||
- Adjust crowdloan derives to use paged key retrieval
|
||||
- Ensure account indices (derived) are `Accountindex` types
|
||||
- Adjust metadata v14 to include top-level type field from metadata
|
||||
- Filter metadata v14 unused enum fields in TS generation
|
||||
- Adjust derives to use more metadata v14 types on returns
|
||||
- Add Kusama & Polkadot upgrade blocks for 9100/9110
|
||||
- Align contract usage with latrest `PortableRegistry` (remove old-generation)
|
||||
- Adjust contracts `InstantiateReturnValue` type (no rent projection after 267)
|
||||
- Adjust for eslint v8 checks
|
||||
- Don't run any online tests on CI by default (uncontrolled external dependencies)
|
||||
|
||||
|
||||
## 6.3.1 Oct 9, 2021
|
||||
|
||||
Upgrade priority: Low. Recoemmended for Kusama & Polkadot runtime 9100+
|
||||
Upgrade priority: Low. Recommended for Kusama & Polkadot runtime 9100+
|
||||
|
||||
Changes:
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"packages/*"
|
||||
],
|
||||
"resolutions": {
|
||||
"typescript": "^4.4.3"
|
||||
"typescript": "^4.4.4"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "yarn build:interfaces && polkadot-dev-build-ts",
|
||||
@@ -29,12 +29,12 @@
|
||||
"@babel/core": "^7.15.8",
|
||||
"@babel/register": "^7.15.3",
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/dev": "^0.62.70",
|
||||
"@polkadot/ts": "^0.4.8",
|
||||
"@polkadot/dev": "^0.63.3",
|
||||
"@polkadot/ts": "^0.4.9",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/jest": "^27.0.2",
|
||||
"copyfiles": "^2.4.1"
|
||||
},
|
||||
"version": "6.3.1",
|
||||
"version": "6.4.2",
|
||||
"packageManager": "yarn@3.0.1"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api-contract",
|
||||
"version": "6.3.1",
|
||||
"version": "6.4.2",
|
||||
"type": "module",
|
||||
"description": "Interfaces for interacting with contracts and contract ABIs",
|
||||
"main": "index.js",
|
||||
@@ -20,9 +20,9 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/api": "6.3.1",
|
||||
"@polkadot/types": "6.3.1",
|
||||
"@polkadot/util": "^7.4.1",
|
||||
"@polkadot/api": "6.4.2",
|
||||
"@polkadot/types": "6.4.2",
|
||||
"@polkadot/util": "^7.5.1",
|
||||
"rxjs": "^7.4.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { blake2AsHex } from '@polkadot/util-crypto';
|
||||
|
||||
import abis from '../test/contracts';
|
||||
import { Abi } from '.';
|
||||
|
||||
interface JSONAbi {
|
||||
source: {
|
||||
compiler: string,
|
||||
hash: string,
|
||||
language: string,
|
||||
wasm: string
|
||||
},
|
||||
spec: {
|
||||
messages: {
|
||||
name: string[] | string
|
||||
}[]
|
||||
}
|
||||
}
|
||||
|
||||
describe('Abi', (): void => {
|
||||
Object.entries(abis).forEach(([abiName, abi]) => {
|
||||
it(`initializes from a contract ABI (${abiName})`, (): void => {
|
||||
try {
|
||||
const messageIds = (abi as JSONAbi).spec.messages.map(({ name }) => Array.isArray(name) ? name[0] : name);
|
||||
const inkAbi = new Abi(abis[abiName]);
|
||||
|
||||
expect(inkAbi.messages.map(({ identifier }) => identifier)).toEqual(messageIds);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('has the correct hash for the source', (): void => {
|
||||
const bundle = abis.ink_flipperBundle as JSONAbi;
|
||||
const abi = new Abi(bundle as any);
|
||||
|
||||
// manual
|
||||
expect(bundle.source.hash).toEqual(blake2AsHex(bundle.source.wasm));
|
||||
|
||||
// the Codec hash
|
||||
expect(bundle.source.hash).toEqual(abi.project.source.wasm.hash.toHex());
|
||||
|
||||
// the hash as per the actual Abi
|
||||
expect(bundle.source.hash).toEqual(abi.project.source.wasmHash.toHex());
|
||||
});
|
||||
});
|
||||
102
packages/api-contract/src/Abi/Abi.spec.ts
Normal file
102
packages/api-contract/src/Abi/Abi.spec.ts
Normal file
@@ -0,0 +1,102 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AnyJson, Registry } from '@polkadot/types/types';
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { TypeDefInfo } from '@polkadot/types/types';
|
||||
import { blake2AsHex } from '@polkadot/util-crypto';
|
||||
|
||||
import abis from '../../test/contracts';
|
||||
import { Abi } from '.';
|
||||
|
||||
interface SpecDef {
|
||||
messages: {
|
||||
name: string[] | string
|
||||
}[]
|
||||
}
|
||||
|
||||
interface JSONAbi {
|
||||
source: {
|
||||
compiler: string,
|
||||
hash: string,
|
||||
language: string,
|
||||
wasm: string
|
||||
},
|
||||
spec: SpecDef;
|
||||
V1: {
|
||||
spec: SpecDef;
|
||||
}
|
||||
}
|
||||
|
||||
function stringifyInfo (key: string, value: unknown): unknown {
|
||||
return key === 'info'
|
||||
? TypeDefInfo[value as number]
|
||||
: value;
|
||||
}
|
||||
|
||||
function stringifyJson (registry: Registry): string {
|
||||
const defs = registry.lookup.types.map(({ id }) =>
|
||||
registry.lookup.getTypeDef(id)
|
||||
);
|
||||
|
||||
return JSON.stringify(defs, stringifyInfo, 2);
|
||||
}
|
||||
|
||||
describe('Abi', (): void => {
|
||||
describe('ABI', (): void => {
|
||||
Object.entries(abis).forEach(([abiName, abi]: [string, JSONAbi]) => {
|
||||
it(`initializes from a contract ABI (${abiName})`, (): void => {
|
||||
try {
|
||||
const messageIds = (abi.V1 ? abi.V1 : abi).spec.messages.map(({ name }) => Array.isArray(name) ? name[0] : name);
|
||||
const inkAbi = new Abi(abis[abiName] as AnyJson);
|
||||
|
||||
expect(inkAbi.messages.map(({ identifier }) => identifier)).toEqual(messageIds);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('TypeDef', (): void => {
|
||||
Object.keys(abis).forEach((abiName) => {
|
||||
it(`initializes from a contract ABI (${abiName})`, (): void => {
|
||||
const abi = new Abi(abis[abiName] as AnyJson);
|
||||
const json = stringifyJson(abi.registry);
|
||||
const cmpPath = path.join(__dirname, `../../test/compare/${abiName}.test.json`);
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
expect(JSON.parse(json)).toEqual(require(cmpPath));
|
||||
} catch (error) {
|
||||
if (process.env.GITHUB_REPOSITORY) {
|
||||
console.error(json);
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
fs.writeFileSync(cmpPath, json, { flag: 'w' });
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('has the correct hash for the source', (): void => {
|
||||
const bundle = abis.ink_v0_flipperBundle as JSONAbi;
|
||||
const abi = new Abi(bundle as unknown as AnyJson);
|
||||
|
||||
// manual
|
||||
expect(bundle.source.hash).toEqual(blake2AsHex(bundle.source.wasm));
|
||||
|
||||
// the Codec hash
|
||||
expect(bundle.source.hash).toEqual(abi.info.source.wasm.hash.toHex());
|
||||
|
||||
// the hash as per the actual Abi
|
||||
expect(bundle.source.hash).toEqual(abi.info.source.wasmHash.toHex());
|
||||
});
|
||||
});
|
||||
@@ -2,16 +2,29 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Bytes } from '@polkadot/types';
|
||||
import type { ChainProperties, ContractConstructorSpec, ContractEventSpec, ContractMessageParamSpec, ContractMessageSpec, ContractProject } from '@polkadot/types/interfaces';
|
||||
import type { AnyJson, Codec } from '@polkadot/types/types';
|
||||
import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from './types';
|
||||
import type { ChainProperties, ContractConstructorSpec, ContractEventSpec, ContractMessageParamSpec, ContractMessageSpec, ContractMetadataLatest, ContractProjectInfo } from '@polkadot/types/interfaces';
|
||||
import type { AnyJson, Codec, Registry } from '@polkadot/types/types';
|
||||
import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from '../types';
|
||||
|
||||
import { TypeDefInfo, TypeRegistry } from '@polkadot/types';
|
||||
import { assert, assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
|
||||
import { MetaRegistry } from './MetaRegistry';
|
||||
import { toLatest } from './toLatest';
|
||||
|
||||
interface V0AbiJson {
|
||||
metadataVersion: string;
|
||||
spec: {
|
||||
constructors: unknown[];
|
||||
events: unknown[];
|
||||
messages: unknown[];
|
||||
};
|
||||
types: unknown[];
|
||||
}
|
||||
|
||||
const l = logger('Abi');
|
||||
|
||||
const PRIMITIVE_ALWAYS = ['AccountId', 'AccountIndex', 'Address', 'Balance'];
|
||||
|
||||
function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string | number): T {
|
||||
const message = isNumber(messageOrId)
|
||||
? list[messageOrId]
|
||||
@@ -22,51 +35,71 @@ function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string
|
||||
return assertReturn(message, () => `Attempted to call an invalid contract interface, ${stringify(messageOrId)}`);
|
||||
}
|
||||
|
||||
function parseJson (json: AnyJson, chainProperties?: ChainProperties): [AnyJson, Registry, ContractMetadataLatest, ContractProjectInfo] {
|
||||
const registry = new TypeRegistry();
|
||||
const info = registry.createType('ContractProjectInfo', json);
|
||||
const metadata = registry.createType('ContractMetadata', isString((json as unknown as V0AbiJson).metadataVersion)
|
||||
? { V0: json }
|
||||
: { V1: (json as Record<string, AnyJson>).V1 }
|
||||
);
|
||||
const latest = metadata.isV0
|
||||
? toLatest(registry, metadata.asV0)
|
||||
: metadata.asV1;
|
||||
const lookup = registry.createType('PortableRegistry', { types: latest.types });
|
||||
|
||||
// attach the lookup to the registry - now the types are known
|
||||
registry.setLookup(lookup);
|
||||
|
||||
if (chainProperties) {
|
||||
registry.setChainProperties(chainProperties);
|
||||
}
|
||||
|
||||
// warm-up the actual type, pre-use
|
||||
lookup.types.forEach(({ id }) =>
|
||||
lookup.getTypeDef(id)
|
||||
);
|
||||
|
||||
return [json, registry, latest, info];
|
||||
}
|
||||
|
||||
export class Abi {
|
||||
readonly #events: AbiEvent[];
|
||||
public readonly events: AbiEvent[];
|
||||
|
||||
public readonly constructors: AbiConstructor[];
|
||||
|
||||
public readonly info: ContractProjectInfo;
|
||||
|
||||
public readonly json: AnyJson;
|
||||
|
||||
public readonly messages: AbiMessage[];
|
||||
|
||||
public readonly project: ContractProject;
|
||||
public readonly metadata: ContractMetadataLatest;
|
||||
|
||||
public readonly registry: MetaRegistry;
|
||||
public readonly registry: Registry;
|
||||
|
||||
constructor (abiJson: AnyJson, chainProperties?: ChainProperties) {
|
||||
const json = isString(abiJson)
|
||||
? JSON.parse(abiJson) as AnyJson
|
||||
: abiJson;
|
||||
|
||||
assert(isObject(json) && !Array.isArray(json) && json.metadataVersion && isObject(json.spec) && !Array.isArray(json.spec) && Array.isArray(json.spec.constructors) && Array.isArray(json.spec.messages), 'Invalid JSON ABI structure supplied, expected a recent metadata version');
|
||||
|
||||
this.json = json;
|
||||
this.registry = new MetaRegistry(json.metadataVersion as string, chainProperties);
|
||||
this.project = this.registry.createType('ContractProject', json);
|
||||
|
||||
this.registry.setMetaTypes(this.project.types);
|
||||
|
||||
this.project.types.forEach((_, index) =>
|
||||
this.registry.getMetaTypeDef({ type: this.registry.createType('Si0LookupTypeId', index + this.registry.typeOffset) })
|
||||
[this.json, this.registry, this.metadata, this.info] = parseJson(
|
||||
isString(abiJson)
|
||||
? JSON.parse(abiJson) as AnyJson
|
||||
: abiJson,
|
||||
chainProperties
|
||||
);
|
||||
this.constructors = this.project.spec.constructors.map((spec: ContractConstructorSpec, index) =>
|
||||
this.constructors = this.metadata.spec.constructors.map((spec: ContractConstructorSpec, index) =>
|
||||
this.#createMessage(spec, index, {
|
||||
isConstructor: true
|
||||
})
|
||||
);
|
||||
this.#events = this.project.spec.events.map((spec: ContractEventSpec, index) =>
|
||||
this.events = this.metadata.spec.events.map((spec: ContractEventSpec, index) =>
|
||||
this.#createEvent(spec, index)
|
||||
);
|
||||
this.messages = this.project.spec.messages.map((spec: ContractMessageSpec, index): AbiMessage => {
|
||||
this.messages = this.metadata.spec.messages.map((spec: ContractMessageSpec, index): AbiMessage => {
|
||||
const typeSpec = spec.returnType.unwrapOr(null);
|
||||
|
||||
return this.#createMessage(spec, index, {
|
||||
isMutating: spec.mutates.isTrue,
|
||||
isPayable: spec.payable.isTrue,
|
||||
returnType: typeSpec
|
||||
? this.registry.getMetaTypeDef(typeSpec)
|
||||
? this.registry.lookup.getTypeDef(typeSpec.type)
|
||||
: null
|
||||
});
|
||||
});
|
||||
@@ -77,7 +110,7 @@ export class Abi {
|
||||
*/
|
||||
public decodeEvent (data: Bytes | Uint8Array): DecodedEvent {
|
||||
const index = data[0];
|
||||
const event = this.#events[index];
|
||||
const event = this.events[index];
|
||||
|
||||
assert(event, () => `Unable to find event with index ${index}`);
|
||||
|
||||
@@ -107,13 +140,32 @@ export class Abi {
|
||||
}
|
||||
|
||||
#createArgs = (args: ContractMessageParamSpec[], spec: unknown): AbiParam[] => {
|
||||
return args.map((arg, index): AbiParam => {
|
||||
return args.map(({ name, type }, index): AbiParam => {
|
||||
try {
|
||||
assert(isObject(arg.type), 'Invalid type definition found');
|
||||
assert(isObject(type), 'Invalid type definition found');
|
||||
|
||||
const displayName = type.displayName.length
|
||||
? type.displayName[type.displayName.length - 1].toString()
|
||||
: undefined;
|
||||
const camelName = stringCamelCase(name);
|
||||
|
||||
if (displayName && PRIMITIVE_ALWAYS.includes(displayName)) {
|
||||
return {
|
||||
name: camelName,
|
||||
type: {
|
||||
info: TypeDefInfo.Plain,
|
||||
type: displayName
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const typeDef = this.registry.lookup.getTypeDef(type.type);
|
||||
|
||||
return {
|
||||
name: stringCamelCase(arg.name),
|
||||
type: this.registry.getMetaTypeDef(arg.type)
|
||||
name: camelName,
|
||||
type: displayName && !typeDef.type.startsWith(displayName)
|
||||
? { displayName, ...typeDef }
|
||||
: typeDef
|
||||
};
|
||||
} catch (error) {
|
||||
l.error(`Error expanding argument ${index} in ${stringify(spec)}`);
|
||||
@@ -121,7 +173,7 @@ export class Abi {
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
#createEvent = (spec: ContractEventSpec, index: number): AbiEvent => {
|
||||
const args = this.#createArgs(spec.args, spec);
|
||||
@@ -137,7 +189,7 @@ export class Abi {
|
||||
};
|
||||
|
||||
return event;
|
||||
}
|
||||
};
|
||||
|
||||
#createMessage = (spec: ContractMessageSpec | ContractConstructorSpec, index: number, add: Partial<AbiMessage> = {}): AbiMessage => {
|
||||
const args = this.#createArgs(spec.args, spec);
|
||||
@@ -159,21 +211,21 @@ export class Abi {
|
||||
};
|
||||
|
||||
return message;
|
||||
}
|
||||
};
|
||||
|
||||
#decodeArgs = (args: AbiParam[], data: Uint8Array): Codec[] => {
|
||||
// for decoding we expect the input to be just the arg data, no selectors
|
||||
// no length added (this allows use with events as well)
|
||||
let offset = 0;
|
||||
|
||||
return args.map(({ type }): Codec => {
|
||||
const value = this.registry.createType(type.type as 'Text', data.subarray(offset));
|
||||
return args.map(({ type: { lookupName, type } }): Codec => {
|
||||
const value = this.registry.createType(lookupName || type, data.subarray(offset));
|
||||
|
||||
offset += value.encodedLength;
|
||||
|
||||
return value;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
#decodeMessage = (type: 'constructor' | 'message', list: AbiMessage[], data: Uint8Array): DecodedMessage => {
|
||||
const [, trimmed] = compactStripLength(data);
|
||||
@@ -183,7 +235,7 @@ export class Abi {
|
||||
assert(message, `Unable to find ${type} with selector ${u8aToHex(selector)}`);
|
||||
|
||||
return message.fromU8a(trimmed.subarray(4));
|
||||
}
|
||||
};
|
||||
|
||||
#encodeArgs = ({ name, selector }: ContractMessageSpec | ContractConstructorSpec, args: AbiParam[], data: unknown[]): Uint8Array => {
|
||||
assert(data.length === args.length, () => `Expected ${args.length} arguments to contract message '${name.toString()}', found ${data.length}`);
|
||||
@@ -191,8 +243,10 @@ export class Abi {
|
||||
return compactAddLength(
|
||||
u8aConcat(
|
||||
this.registry.createType('ContractSelector', selector).toU8a(),
|
||||
...args.map(({ type }, index) => this.registry.createType(type.type as 'Text', data[index]).toU8a())
|
||||
...args.map(({ type: { lookupName, type } }, index) =>
|
||||
this.registry.createType(lookupName || type, data[index]).toU8a()
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
14
packages/api-contract/src/Abi/toLatest.ts
Normal file
14
packages/api-contract/src/Abi/toLatest.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ContractMetadataLatest, ContractMetadataV0 } from '@polkadot/types/interfaces';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
|
||||
import { convertSiV0toV1 } from '@polkadot/types/generic/PortableRegistry';
|
||||
|
||||
export function toLatest (registry: Registry, v0: ContractMetadataV0): ContractMetadataLatest {
|
||||
return registry.createType('ContractMetadataLatest', {
|
||||
...v0,
|
||||
types: convertSiV0toV1(registry, v0.types)
|
||||
});
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { TypeDefInfo } from '@polkadot/types/types';
|
||||
|
||||
import abis from '../test/contracts';
|
||||
import { Abi } from '.';
|
||||
|
||||
function stringifyInfo (key: string, value: unknown): unknown {
|
||||
return key === 'info'
|
||||
? TypeDefInfo[value as number]
|
||||
: value;
|
||||
}
|
||||
|
||||
describe('MetaRegistry', (): void => {
|
||||
Object.keys(abis).forEach((abiName) => {
|
||||
it(`initializes from a contract ABI (${abiName})`, (): void => {
|
||||
const abi = new Abi(abis[abiName]);
|
||||
const json = JSON.stringify(abi.registry.metaTypeDefs, stringifyInfo, 2);
|
||||
const cmpPath = path.join(__dirname, `../test/compare/${abiName}.test.json`);
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
expect(JSON.parse(json)).toEqual(require(cmpPath));
|
||||
} catch (error) {
|
||||
if (process.env.GITHUB_REPOSITORY) {
|
||||
console.error(JSON.stringify(abi.registry.metaTypeDefs, stringifyInfo));
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
fs.writeFileSync(cmpPath, json, { flag: 'w' });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('stores base project as JSON', (): void => {
|
||||
expect(new Abi(abis.ink_dns).json).toEqual(abis.ink_dns);
|
||||
});
|
||||
});
|
||||
@@ -1,252 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ChainProperties, ContractDisplayName, Si0Field, Si0LookupTypeId, Si0Type, Si0TypeDefArray, Si0TypeDefSequence, Si0TypeDefTuple, Si0TypeDefVariant, Si0Variant } from '@polkadot/types/interfaces';
|
||||
import type { InterfaceTypes, TypeDef } from '@polkadot/types/types';
|
||||
|
||||
import { TypeDefInfo, TypeRegistry, withTypeString } from '@polkadot/types';
|
||||
import { assert, isUndefined } from '@polkadot/util';
|
||||
|
||||
interface PartialTypeSpec {
|
||||
readonly type: Si0LookupTypeId;
|
||||
readonly displayName?: ContractDisplayName;
|
||||
}
|
||||
|
||||
// convert the offset into project-specific, index-1
|
||||
export function getRegistryOffset (id: Si0LookupTypeId, typeOffset: number): number {
|
||||
return id.toNumber() - typeOffset;
|
||||
}
|
||||
|
||||
const PRIMITIVE_ALIAS: Record<string, keyof InterfaceTypes> = {
|
||||
Char: 'u32', // Rust char is 4-bytes
|
||||
Str: 'Text'
|
||||
};
|
||||
|
||||
const PRIMITIVE_ALWAYS = ['AccountId', 'AccountIndex', 'Address', 'Balance'];
|
||||
|
||||
// TODO Replace usages with PortableRegistry
|
||||
export class MetaRegistry extends TypeRegistry {
|
||||
public readonly metaTypeDefs: TypeDef[] = [];
|
||||
|
||||
public readonly typeOffset;
|
||||
|
||||
#siTypes: Si0Type[] = [];
|
||||
|
||||
constructor (metadataVersion: string, chainProperties?: ChainProperties) {
|
||||
super();
|
||||
|
||||
const [major, minor] = metadataVersion.split('.').map((n) => parseInt(n, 10));
|
||||
|
||||
// type indexes are 1-based pre 0.7 and 0-based post
|
||||
this.typeOffset = (major === 0 && minor < 7) ? 1 : 0;
|
||||
|
||||
if (chainProperties) {
|
||||
this.setChainProperties(chainProperties);
|
||||
}
|
||||
}
|
||||
|
||||
public setMetaTypes (metaTypes: Si0Type[]): void {
|
||||
this.#siTypes = metaTypes;
|
||||
}
|
||||
|
||||
public getMetaTypeDef (typeSpec: PartialTypeSpec): TypeDef {
|
||||
const offset = getRegistryOffset(typeSpec.type, this.typeOffset);
|
||||
let typeDef = this.metaTypeDefs[offset];
|
||||
|
||||
if (!typeDef) {
|
||||
typeDef = this.#extract(this.#getMetaType(typeSpec.type), typeSpec.type);
|
||||
|
||||
this.metaTypeDefs[offset] = typeDef;
|
||||
}
|
||||
|
||||
if (typeSpec.displayName && typeSpec.displayName.length) {
|
||||
const displayName = typeSpec.displayName[typeSpec.displayName.length - 1].toString();
|
||||
|
||||
if (!typeDef.type.startsWith(displayName)) {
|
||||
typeDef = {
|
||||
...typeDef,
|
||||
displayName,
|
||||
type: PRIMITIVE_ALWAYS.includes(displayName)
|
||||
? displayName
|
||||
: typeDef.type
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Here we protect against the following cases
|
||||
// - No displayName present, these are generally known primitives
|
||||
// - displayName === type, these generate circular references
|
||||
// - displayName Option & type Option<...something...>
|
||||
if (typeDef.displayName && !this.hasType(typeDef.displayName) && !(typeDef.type === typeDef.displayName || typeDef.type.startsWith(`${typeDef.displayName}<`))) {
|
||||
this.register({ [typeDef.displayName]: typeDef.type });
|
||||
}
|
||||
|
||||
return typeDef;
|
||||
}
|
||||
|
||||
#getMetaType = (id: Si0LookupTypeId): Si0Type => {
|
||||
const type = this.#siTypes[getRegistryOffset(id, this.typeOffset)];
|
||||
|
||||
assert(!isUndefined(type), () => `getMetaType:: Unable to find ${id.toNumber()} in type values`);
|
||||
|
||||
return this.createType('Si0Type', type);
|
||||
}
|
||||
|
||||
#extract = (type: Si0Type, id: Si0LookupTypeId): TypeDef => {
|
||||
const path = [...type.path];
|
||||
const isPrimitivePath = !!path.length && (
|
||||
(path.length > 2 && path[0].eq('ink_env') && path[1].eq('types')) ||
|
||||
PRIMITIVE_ALWAYS.includes(path[path.length - 1].toString())
|
||||
);
|
||||
let typeDef: Omit<TypeDef, 'type'>;
|
||||
|
||||
if (isPrimitivePath) {
|
||||
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);
|
||||
} else if (type.def.isVariant) {
|
||||
typeDef = this.#extractVariant(type.def.asVariant, id);
|
||||
} else if (type.def.isArray) {
|
||||
typeDef = this.#extractArray(type.def.asArray);
|
||||
} else if (type.def.isSequence) {
|
||||
typeDef = this.#extractSequence(type.def.asSequence, id);
|
||||
} else if (type.def.isTuple) {
|
||||
typeDef = this.#extractTuple(type.def.asTuple);
|
||||
} else {
|
||||
throw new Error(`Invalid ink! type at index ${id.toString()}`);
|
||||
}
|
||||
|
||||
const displayName = path.pop()?.toString();
|
||||
|
||||
return withTypeString(this, {
|
||||
...(displayName
|
||||
? { displayName }
|
||||
: {}
|
||||
),
|
||||
...(path.length > 1
|
||||
? { namespace: path.map((s) => s.toString()).join('::') }
|
||||
: {}
|
||||
),
|
||||
...(type.params.length > 0
|
||||
? { sub: type.params.map((type) => this.getMetaTypeDef({ type })) }
|
||||
: {}
|
||||
),
|
||||
...typeDef
|
||||
});
|
||||
}
|
||||
|
||||
#extractArray = ({ len: length, type }: Si0TypeDefArray): Omit<TypeDef, 'type'> => {
|
||||
assert(!length || length.toNumber() <= 256, 'MetaRegistry: Only support for [Type; <length>], where length <= 256');
|
||||
|
||||
return {
|
||||
info: TypeDefInfo.VecFixed,
|
||||
length: length.toNumber(),
|
||||
sub: this.getMetaTypeDef({ type })
|
||||
};
|
||||
}
|
||||
|
||||
#extractFields = (fields: Si0Field[]): Omit<TypeDef, 'type'> => {
|
||||
const [isStruct, isTuple] = fields.reduce(([isAllNamed, isAllUnnamed], { name }) => ([
|
||||
isAllNamed && name.isSome,
|
||||
isAllUnnamed && name.isNone
|
||||
]),
|
||||
[true, true]);
|
||||
|
||||
assert(isTuple || isStruct, 'Invalid fields type detected, expected either Tuple or Struct');
|
||||
|
||||
const sub = fields.map(({ name, type }) => ({
|
||||
...this.getMetaTypeDef({ type }),
|
||||
...(name.isSome
|
||||
? { name: name.unwrap().toString() }
|
||||
: {}
|
||||
)
|
||||
}));
|
||||
|
||||
return isTuple && sub.length === 1
|
||||
? sub[0]
|
||||
: {
|
||||
// check for tuple first (no fields may be available)
|
||||
info: isTuple
|
||||
? TypeDefInfo.Tuple
|
||||
: TypeDefInfo.Struct,
|
||||
sub
|
||||
};
|
||||
}
|
||||
|
||||
#extractPrimitive = (type: Si0Type): TypeDef => {
|
||||
const typeStr = type.def.asPrimitive.type.toString();
|
||||
|
||||
return {
|
||||
info: TypeDefInfo.Plain,
|
||||
type: PRIMITIVE_ALIAS[typeStr] || typeStr.toLowerCase()
|
||||
};
|
||||
}
|
||||
|
||||
#extractPrimitivePath = (type: Si0Type): TypeDef => {
|
||||
return {
|
||||
info: TypeDefInfo.Plain,
|
||||
type: type.path[type.path.length - 1].toString()
|
||||
};
|
||||
}
|
||||
|
||||
#extractSequence = ({ type }: Si0TypeDefSequence, id: Si0LookupTypeId): Omit<TypeDef, 'type'> => {
|
||||
assert(!!type, () => `ContractRegistry: Invalid sequence type found at id ${id.toString()}`);
|
||||
|
||||
return {
|
||||
info: TypeDefInfo.Vec,
|
||||
sub: this.getMetaTypeDef({ type })
|
||||
};
|
||||
}
|
||||
|
||||
#extractTuple = (ids: Si0TypeDefTuple): Omit<TypeDef, 'type'> => {
|
||||
return ids.length === 1
|
||||
? this.getMetaTypeDef({ type: ids[0] })
|
||||
: {
|
||||
info: TypeDefInfo.Tuple,
|
||||
sub: ids.map((type) => this.getMetaTypeDef({ type }))
|
||||
};
|
||||
}
|
||||
|
||||
#extractVariant = ({ variants }: Si0TypeDefVariant, id: Si0LookupTypeId): Omit<TypeDef, 'type'> => {
|
||||
const { params, path } = this.#getMetaType(id);
|
||||
const specialVariant = path[0].toString();
|
||||
|
||||
return specialVariant === 'Option'
|
||||
? {
|
||||
info: TypeDefInfo.Option,
|
||||
sub: this.getMetaTypeDef({ type: params[0] })
|
||||
}
|
||||
: specialVariant === 'Result'
|
||||
? {
|
||||
info: TypeDefInfo.Result,
|
||||
sub: params.map((type, index) => ({
|
||||
name: ['Ok', 'Error'][index],
|
||||
...this.getMetaTypeDef({ type })
|
||||
}))
|
||||
}
|
||||
: {
|
||||
info: TypeDefInfo.Enum,
|
||||
sub: this.#extractVariantSub(variants)
|
||||
};
|
||||
}
|
||||
|
||||
#extractVariantSub = (variants: Si0Variant[]): TypeDef[] => {
|
||||
return variants.every(({ fields }) => fields.length === 0)
|
||||
? variants.map(({ discriminant, name }) => ({
|
||||
...(
|
||||
discriminant.isSome
|
||||
? { ext: { discriminant: discriminant.unwrap().toNumber() } }
|
||||
: {}
|
||||
),
|
||||
info: TypeDefInfo.Plain,
|
||||
name: name.toString(),
|
||||
type: 'Null'
|
||||
}))
|
||||
: variants.map(({ fields, name }) => withTypeString(this, {
|
||||
...this.#extractFields(fields),
|
||||
name: name.toString()
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -14,8 +14,6 @@ export abstract class Base<ApiType extends ApiTypes> {
|
||||
|
||||
public readonly api: ApiBase<ApiType>;
|
||||
|
||||
public readonly registry: Registry;
|
||||
|
||||
protected readonly _decorateMethod: DecorateMethod<ApiType>;
|
||||
|
||||
constructor (api: ApiBase<ApiType>, abi: AnyJson | Abi, decorateMethod: DecorateMethod<ApiType>) {
|
||||
@@ -23,10 +21,13 @@ export abstract class Base<ApiType extends ApiTypes> {
|
||||
? abi
|
||||
: new Abi(abi, api.registry.getChainProperties());
|
||||
this.api = api;
|
||||
this.registry = this.abi.registry;
|
||||
this._decorateMethod = decorateMethod;
|
||||
|
||||
assert(!!(api && api.isConnected && api.tx && api.tx.contracts && Object.keys(api.tx.contracts).length), 'Your API has not been initialized correctly and it not decorated with the runtime interfaces for contracts as retrieved from the on-chain runtime');
|
||||
assert(isFunction(api.tx.contracts.instantiateWithCode), 'You need to connect to a chain with a runtime with a V3 contracts module. The runtime does not expose api.tx.contracts.instantiateWithCode');
|
||||
}
|
||||
|
||||
public get registry (): Registry {
|
||||
return this.api.registry;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,5 +66,5 @@ export class Blueprint<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
new Contract<ApiType>(this.api, this.abi, record.event.data[1] as AccountId, this._decorateMethod)
|
||||
))
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,28 +1,37 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AnyJson } from '@polkadot/types/types';
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { decorateMethodPromise } from '@polkadot/api';
|
||||
|
||||
import contractFlipper from '../../test/contracts/ink/flipper.contract.json';
|
||||
import abiFlipper from '../../test/contracts/ink/flipper.json';
|
||||
import v0contractFlipper from '../../test/contracts/ink/v0/flipper.contract.json';
|
||||
import v0abiFlipper from '../../test/contracts/ink/v0/flipper.json';
|
||||
import v1contractFlipper from '../../test/contracts/ink/v1/flipper.contract.json';
|
||||
import { Code } from './Code';
|
||||
import { mockApi } from './mock';
|
||||
|
||||
const wasmFlipper = fs.readFileSync(path.join(__dirname, '../../test/contracts/ink/flipper.wasm'));
|
||||
const v0wasmFlipper = fs.readFileSync(path.join(__dirname, '../../test/contracts/ink/v0/flipper.wasm'));
|
||||
|
||||
describe('Code', (): void => {
|
||||
it('can construct with an individual ABI/WASM combo', (): void => {
|
||||
expect(
|
||||
() => new Code(mockApi, abiFlipper, wasmFlipper, decorateMethodPromise)
|
||||
() => new Code(mockApi, v0abiFlipper as AnyJson, v0wasmFlipper, decorateMethodPromise)
|
||||
).not.toThrow();
|
||||
});
|
||||
|
||||
it('can construct with an .contract ABI', (): void => {
|
||||
it('can construct with an .contract ABI (v0)', (): void => {
|
||||
expect(
|
||||
() => new Code(mockApi, contractFlipper, null, decorateMethodPromise)
|
||||
() => new Code(mockApi, v0contractFlipper as AnyJson, null, decorateMethodPromise)
|
||||
).not.toThrow();
|
||||
});
|
||||
|
||||
it.only('can construct with an .contract ABI (v1)', (): void => {
|
||||
expect(
|
||||
() => new Code(mockApi, v1contractFlipper as AnyJson, null, decorateMethodPromise)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -39,8 +39,8 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
constructor (api: ApiBase<ApiType>, abi: AnyJson | Abi, wasm: Uint8Array | string | Buffer | null | undefined, decorateMethod: DecorateMethod<ApiType>) {
|
||||
super(api, abi, decorateMethod);
|
||||
|
||||
this.code = isWasm(this.abi.project.source.wasm)
|
||||
? this.abi.project.source.wasm
|
||||
this.code = isWasm(this.abi.info.source.wasm)
|
||||
? this.abi.info.source.wasm
|
||||
: u8aToU8a(wasm);
|
||||
|
||||
assert(isWasm(this.code), 'No WASM code provided');
|
||||
@@ -76,5 +76,5 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
[])
|
||||
) || []))
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import { map } from 'rxjs';
|
||||
|
||||
import { SubmittableResult } from '@polkadot/api';
|
||||
import { ApiBase } from '@polkadot/api/base';
|
||||
import { createTypeUnsafe } from '@polkadot/types';
|
||||
import { assert, BN, BN_HUNDRED, BN_ONE, BN_ZERO, bnToBn, isFunction, isUndefined, logger } from '@polkadot/util';
|
||||
|
||||
import { Abi } from '../Abi';
|
||||
@@ -101,7 +100,7 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
: this.api.consts.system.maximumBlockWeight as Weight
|
||||
).muln(64).div(BN_HUNDRED)
|
||||
: gasLimit;
|
||||
}
|
||||
};
|
||||
|
||||
#exec = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, value = BN_ZERO }: ContractOptions, params: unknown[]): SubmittableExtrinsic<ApiType> => {
|
||||
return this.api.tx.contracts
|
||||
@@ -127,7 +126,7 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
.filter((decoded): decoded is DecodedEvent => !!decoded)
|
||||
))
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
#read = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, value = BN_ZERO }: ContractOptions, params: unknown[]): ContractCallSend<ApiType> => {
|
||||
assert(this.hasRpcContractsCall, ERROR_NO_CALL);
|
||||
@@ -153,12 +152,12 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
? gasRequired
|
||||
: gasConsumed,
|
||||
output: result.isOk && message.returnType
|
||||
? createTypeUnsafe(this.registry, message.returnType.type, [result.asOk.data.toU8a(true)], { isPedantic: true })
|
||||
? this.abi.registry.createTypeUnsafe(message.returnType.lookupName || message.returnType.type, [result.asOk.data.toU8a(true)], { isPedantic: true })
|
||||
: null,
|
||||
result
|
||||
}))
|
||||
)
|
||||
)
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
// Simple non-runnable checks to test type definitions in the editor itself
|
||||
|
||||
import type { AnyJson } from '@polkadot/types/types';
|
||||
|
||||
import { ApiPromise } from '@polkadot/api';
|
||||
import { createTestPairs, TestKeyringMap } from '@polkadot/keyring/testingPairs';
|
||||
|
||||
@@ -10,7 +12,7 @@ import abiIncrementer from '../test/contracts/ink/incrementer.json';
|
||||
import { BlueprintPromise, ContractPromise } from '.';
|
||||
|
||||
async function checkBlueprint (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
const blueprint = new BlueprintPromise(api, abiIncrementer, '0x1234');
|
||||
const blueprint = new BlueprintPromise(api, abiIncrementer as AnyJson, '0x1234');
|
||||
|
||||
// new style
|
||||
await blueprint.tx.new({ gasLimit: 456, salt: '0x1234', value: 123 }, 42).signAndSend(pairs.bob);
|
||||
@@ -21,7 +23,7 @@ async function checkBlueprint (api: ApiPromise, pairs: TestKeyringMap): Promise<
|
||||
}
|
||||
|
||||
async function checkContract (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
const contract = new ContractPromise(api, abiIncrementer, '0x1234');
|
||||
const contract = new ContractPromise(api, abiIncrementer as AnyJson, '0x1234');
|
||||
|
||||
// queries
|
||||
await contract.query.get(pairs.alice.address, {});
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-contract', version: '6.3.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', version: '6.4.2' };
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
[
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "i32"
|
||||
},
|
||||
{
|
||||
"displayName": "Hash",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "Hash"
|
||||
}
|
||||
]
|
||||
@@ -1,204 +0,0 @@
|
||||
[
|
||||
{
|
||||
"displayName": "Header",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "last_vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len_entries"
|
||||
}
|
||||
],
|
||||
"type": "{\"last_vacant\":\"u32\",\"len\":\"u32\",\"len_entries\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"displayName": "Entry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"displayName": "Hash",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "Hash",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"Hash\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "Hash",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "Hash"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"displayName": "ValueEntry",
|
||||
"namespace": "ink_storage::collections::hashmap",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"AccountId\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"displayName": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"displayName": "Error",
|
||||
"namespace": "dns::dns",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 0
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "NameAlreadyExists",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 1
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "CallerIsNotOwner",
|
||||
"type": "Null"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":[\"NameAlreadyExists\",\"CallerIsNotOwner\"]}"
|
||||
}
|
||||
],
|
||||
"info": "Result",
|
||||
"type": "Result<(), Error>"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"displayName": "Error",
|
||||
"namespace": "dns::dns",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 0
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "NameAlreadyExists",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 1
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "CallerIsNotOwner",
|
||||
"type": "Null"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":[\"NameAlreadyExists\",\"CallerIsNotOwner\"]}"
|
||||
},
|
||||
{
|
||||
"displayName": "Option",
|
||||
"sub": {
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
"info": "Option",
|
||||
"type": "Option<AccountId>"
|
||||
}
|
||||
]
|
||||
@@ -1,201 +0,0 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u128"
|
||||
},
|
||||
{
|
||||
"displayName": "Header",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "last_vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len_entries"
|
||||
}
|
||||
],
|
||||
"type": "{\"last_vacant\":\"u32\",\"len\":\"u32\",\"len_entries\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"displayName": "Entry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"AccountId\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"displayName": "ValueEntry",
|
||||
"namespace": "ink_storage::collections::hashmap",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u128",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"u128\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"displayName": "Entry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
"type": "(AccountId,AccountId)",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
"type": "(AccountId,AccountId)"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"displayName": "Option",
|
||||
"sub": {
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
"info": "Option",
|
||||
"type": "Option<AccountId>"
|
||||
}
|
||||
]
|
||||
@@ -1,430 +0,0 @@
|
||||
[
|
||||
{
|
||||
"displayName": "Header",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "last_vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len_entries"
|
||||
}
|
||||
],
|
||||
"type": "{\"last_vacant\":\"u32\",\"len\":\"u32\",\"len_entries\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"displayName": "Entry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"u32\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"displayName": "ValueEntry",
|
||||
"namespace": "ink_storage::collections::hashmap",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"AccountId\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"displayName": "Entry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"AccountId\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "ValueEntry",
|
||||
"namespace": "ink_storage::collections::hashmap",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"u32\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"displayName": "Entry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
"type": "(AccountId,AccountId)",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
"type": "(AccountId,AccountId)"
|
||||
},
|
||||
{
|
||||
"displayName": "ValueEntry",
|
||||
"namespace": "ink_storage::collections::hashmap",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "bool",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"bool\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"displayName": "Option",
|
||||
"sub": {
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
"info": "Option",
|
||||
"type": "Option<AccountId>"
|
||||
},
|
||||
{
|
||||
"displayName": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"displayName": "Error",
|
||||
"namespace": "erc721::erc721",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 0
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "NotOwner",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 1
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "NotApproved",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 2
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "TokenExists",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 3
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "TokenNotFound",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 4
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "CannotInsert",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 5
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "CannotRemove",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 6
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "CannotFetchValue",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 7
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "NotAllowed",
|
||||
"type": "Null"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":[\"NotOwner\",\"NotApproved\",\"TokenExists\",\"TokenNotFound\",\"CannotInsert\",\"CannotRemove\",\"CannotFetchValue\",\"NotAllowed\"]}"
|
||||
}
|
||||
],
|
||||
"info": "Result",
|
||||
"type": "Result<(), Error>"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"displayName": "Error",
|
||||
"namespace": "erc721::erc721",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 0
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "NotOwner",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 1
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "NotApproved",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 2
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "TokenExists",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 3
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "TokenNotFound",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 4
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "CannotInsert",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 5
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "CannotRemove",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 6
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "CannotFetchValue",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 7
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "NotAllowed",
|
||||
"type": "Null"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":[\"NotOwner\",\"NotApproved\",\"TokenExists\",\"TokenNotFound\",\"CannotInsert\",\"CannotRemove\",\"CannotFetchValue\",\"NotAllowed\"]}"
|
||||
}
|
||||
]
|
||||
@@ -1,6 +0,0 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "bool"
|
||||
}
|
||||
]
|
||||
@@ -1,6 +0,0 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "bool"
|
||||
}
|
||||
]
|
||||
@@ -1,6 +0,0 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "i32"
|
||||
}
|
||||
]
|
||||
@@ -1,514 +0,0 @@
|
||||
[
|
||||
{
|
||||
"displayName": "Header",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "last_vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len_entries"
|
||||
}
|
||||
],
|
||||
"type": "{\"last_vacant\":\"u32\",\"len\":\"u32\",\"len_entries\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"displayName": "Entry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
"type": "(u32,AccountId)",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"(u32,AccountId)\"}}"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
"type": "(u32,AccountId)"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"displayName": "ValueEntry",
|
||||
"namespace": "ink_storage::collections::hashmap",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"()\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"displayName": "Entry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"u32\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "ValueEntry",
|
||||
"namespace": "ink_storage::collections::hashmap",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"u32\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"displayName": "Entry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"displayName": "Transaction",
|
||||
"namespace": "multisig_plain::multisig_plain",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "callee"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"length": 4,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;4]",
|
||||
"name": "selector"
|
||||
},
|
||||
{
|
||||
"info": "Vec",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "Vec<u8>",
|
||||
"name": "input"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u128",
|
||||
"name": "transferred_value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u64",
|
||||
"name": "gas_limit"
|
||||
}
|
||||
],
|
||||
"type": "{\"callee\":\"AccountId\",\"selector\":\"[u8;4]\",\"input\":\"Vec<u8>\",\"transferred_value\":\"u128\",\"gas_limit\":\"u64\"}",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"Transaction\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "Transaction",
|
||||
"namespace": "multisig_plain::multisig_plain",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "callee"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"length": 4,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;4]",
|
||||
"name": "selector"
|
||||
},
|
||||
{
|
||||
"info": "Vec",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "Vec<u8>",
|
||||
"name": "input"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u128",
|
||||
"name": "transferred_value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u64",
|
||||
"name": "gas_limit"
|
||||
}
|
||||
],
|
||||
"type": "{\"callee\":\"AccountId\",\"selector\":\"[u8;4]\",\"input\":\"Vec<u8>\",\"transferred_value\":\"u128\",\"gas_limit\":\"u64\"}"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"length": 4,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;4]"
|
||||
},
|
||||
{
|
||||
"info": "Vec",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "Vec<u8>"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u128"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u64"
|
||||
},
|
||||
{
|
||||
"displayName": "Entry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"AccountId\"}}"
|
||||
},
|
||||
{
|
||||
"info": "Vec",
|
||||
"sub": {
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
"type": "Vec<AccountId>"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"displayName": "ConfirmationStatus",
|
||||
"namespace": "multisig_plain::multisig_plain",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Confirmed",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "ConfirmationsNeeded"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":{\"Confirmed\":\"()\",\"ConfirmationsNeeded\":\"u32\"}}"
|
||||
}
|
||||
],
|
||||
"type": "(u32,ConfirmationStatus)"
|
||||
},
|
||||
{
|
||||
"displayName": "ConfirmationStatus",
|
||||
"namespace": "multisig_plain::multisig_plain",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Confirmed",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "ConfirmationsNeeded"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":{\"Confirmed\":\"()\",\"ConfirmationsNeeded\":\"u32\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
}
|
||||
],
|
||||
"info": "Result",
|
||||
"type": "Result<(), ()>"
|
||||
},
|
||||
{
|
||||
"displayName": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Vec",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "Vec<u8>"
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
}
|
||||
],
|
||||
"info": "Result",
|
||||
"type": "Result<Vec<u8>, ()>"
|
||||
},
|
||||
{
|
||||
"displayName": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"displayName": "Option",
|
||||
"sub": {
|
||||
"info": "Vec",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "Vec<u8>"
|
||||
},
|
||||
"info": "Option",
|
||||
"type": "Option<Vec<u8>>"
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"type": "()"
|
||||
}
|
||||
],
|
||||
"info": "Result",
|
||||
"type": "Result<Option<Vec<u8>>, ()>"
|
||||
},
|
||||
{
|
||||
"displayName": "Option",
|
||||
"sub": {
|
||||
"info": "Vec",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "Vec<u8>"
|
||||
},
|
||||
"info": "Option",
|
||||
"type": "Option<Vec<u8>>"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,47 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 2,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "i32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "Hash",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::Hash",
|
||||
"lookupNameRoot": "InkEnvHash"
|
||||
}
|
||||
]
|
||||
232
packages/api-contract/test/compare/ink_v0_dns.test.json
Normal file
232
packages/api-contract/test/compare/ink_v0_dns.test.json
Normal file
@@ -0,0 +1,232 @@
|
||||
[
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 1,
|
||||
"lookupName": "InkStorageCollectionsStashHeader",
|
||||
"type": "{\"lastVacant\":\"u32\",\"len\":\"u32\",\"lenEntries\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Header",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lastVacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lenEntries"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 3,
|
||||
"lookupName": "InkStorageCollectionsStashEntry",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"Hash\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 7,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup7",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "Hash",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::Hash",
|
||||
"lookupNameRoot": "InkEnvHash",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "Hash",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::Hash",
|
||||
"lookupNameRoot": "InkEnvHash"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 5,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 7,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::VacantEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "prev"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsHashmapValueEntry",
|
||||
"type": "{\"value\":\"AccountId\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 9,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 9,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Result",
|
||||
"lookupIndex": 10,
|
||||
"type": "Result<Null, DnsError>",
|
||||
"docs": [],
|
||||
"namespace": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Null",
|
||||
"lookupIndex": 11,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 12,
|
||||
"lookupName": "DnsError",
|
||||
"type": "Lookup12"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"lookupIndex": 11,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 12,
|
||||
"lookupName": "DnsError",
|
||||
"type": "{\"_enum\":[\"NameAlreadyExists\",\"CallerIsNotOwner\"]}",
|
||||
"docs": [],
|
||||
"namespace": "dns::dns::Error",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "NameAlreadyExists"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 1,
|
||||
"name": "CallerIsNotOwner"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Option",
|
||||
"lookupIndex": 13,
|
||||
"type": "Option<AccountId>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 9,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
}
|
||||
]
|
||||
252
packages/api-contract/test/compare/ink_v0_erc20.test.json
Normal file
252
packages/api-contract/test/compare/ink_v0_erc20.test.json
Normal file
@@ -0,0 +1,252 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 2,
|
||||
"lookupName": "InkStorageCollectionsStashHeader",
|
||||
"type": "{\"lastVacant\":\"u32\",\"len\":\"u32\",\"lenEntries\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Header",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lastVacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lenEntries"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 4,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"AccountId\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 6,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::VacantEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "prev"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 9,
|
||||
"lookupName": "InkStorageCollectionsHashmapValueEntry",
|
||||
"type": "{\"value\":\"u128\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 10,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 11,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
],
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 11,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 12,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Option",
|
||||
"lookupIndex": 13,
|
||||
"type": "Option<AccountId>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
}
|
||||
]
|
||||
412
packages/api-contract/test/compare/ink_v0_erc721.test.json
Normal file
412
packages/api-contract/test/compare/ink_v0_erc721.test.json
Normal file
@@ -0,0 +1,412 @@
|
||||
[
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 1,
|
||||
"lookupName": "InkStorageCollectionsStashHeader",
|
||||
"type": "{\"lastVacant\":\"u32\",\"len\":\"u32\",\"lenEntries\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Header",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lastVacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lenEntries"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 3,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"u32\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 4,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup4",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 4,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::VacantEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "prev"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 5,
|
||||
"type": "{\"value\":\"AccountId\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 7,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 8,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 8,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 9,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"AccountId\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 4,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup4",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 10,
|
||||
"type": "{\"value\":\"u32\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 11,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 4,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup4",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 12,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
],
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 12,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 13,
|
||||
"type": "{\"value\":\"bool\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 14,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 14,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Option",
|
||||
"lookupIndex": 15,
|
||||
"type": "Option<AccountId>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Result",
|
||||
"lookupIndex": 16,
|
||||
"type": "Result<Null, Erc721Error>",
|
||||
"docs": [],
|
||||
"namespace": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Null",
|
||||
"lookupIndex": 17,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 18,
|
||||
"lookupName": "Erc721Error",
|
||||
"type": "Lookup18"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"lookupIndex": 17,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 18,
|
||||
"lookupName": "Erc721Error",
|
||||
"type": "{\"_enum\":[\"NotOwner\",\"NotApproved\",\"TokenExists\",\"TokenNotFound\",\"CannotInsert\",\"CannotRemove\",\"CannotFetchValue\",\"NotAllowed\"]}",
|
||||
"docs": [],
|
||||
"namespace": "erc721::erc721::Error",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "NotOwner"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 1,
|
||||
"name": "NotApproved"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 2,
|
||||
"name": "TokenExists"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 3,
|
||||
"name": "TokenNotFound"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 4,
|
||||
"name": "CannotInsert"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 5,
|
||||
"name": "CannotRemove"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 6,
|
||||
"name": "CannotFetchValue"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 7,
|
||||
"name": "NotAllowed"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "i32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,560 @@
|
||||
[
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 1,
|
||||
"lookupName": "InkStorageCollectionsStashHeader",
|
||||
"type": "{\"lastVacant\":\"u32\",\"len\":\"u32\",\"lenEntries\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Header",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lastVacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lenEntries"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 3,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(u32,AccountId)\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 4,
|
||||
"type": "(u32,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
],
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 4,
|
||||
"type": "(u32,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 6,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::VacantEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "prev"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 9,
|
||||
"type": "{\"value\":\"Null\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"lookupIndex": 10,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"lookupIndex": 10,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 11,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"u32\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 12,
|
||||
"type": "{\"value\":\"u32\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 13,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"MultisigPlainMultisigPlainTransaction\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 14,
|
||||
"lookupName": "MultisigPlainMultisigPlainTransaction",
|
||||
"type": "Lookup14",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 14,
|
||||
"lookupName": "MultisigPlainMultisigPlainTransaction",
|
||||
"type": "{\"callee\":\"AccountId\",\"selector\":\"[u8;4]\",\"input\":\"Bytes\",\"transferredValue\":\"u128\",\"gasLimit\":\"u64\"}",
|
||||
"docs": [],
|
||||
"namespace": "multisig_plain::multisig_plain::Transaction",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"name": "callee"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 15,
|
||||
"type": "[u8;4]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 4,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
"name": "selector"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 16,
|
||||
"type": "Bytes",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "input"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 17,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "transferredValue"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 18,
|
||||
"type": "u64",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "gasLimit"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 15,
|
||||
"type": "[u8;4]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 4,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 16,
|
||||
"type": "Bytes",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 17,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 18,
|
||||
"type": "u64",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 19,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"AccountId\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Vec",
|
||||
"lookupIndex": 20,
|
||||
"type": "Vec<AccountId>",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 21,
|
||||
"type": "(u32,MultisigPlainMultisigPlainConfirmationStatus)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 22,
|
||||
"lookupName": "MultisigPlainMultisigPlainConfirmationStatus",
|
||||
"type": "Lookup22"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 22,
|
||||
"lookupName": "MultisigPlainMultisigPlainConfirmationStatus",
|
||||
"type": "{\"_enum\":{\"Confirmed\":\"Null\",\"ConfirmationsNeeded\":\"u32\"}}",
|
||||
"docs": [],
|
||||
"namespace": "multisig_plain::multisig_plain::ConfirmationStatus",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "Confirmed"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"index": 1,
|
||||
"name": "ConfirmationsNeeded"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Result",
|
||||
"lookupIndex": 23,
|
||||
"type": "Result<Null, Null>",
|
||||
"docs": [],
|
||||
"namespace": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Null",
|
||||
"lookupIndex": 10,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"info": "Null",
|
||||
"lookupIndex": 10,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Result",
|
||||
"lookupIndex": 24,
|
||||
"type": "Result<Bytes, Null>",
|
||||
"docs": [],
|
||||
"namespace": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Plain",
|
||||
"lookupIndex": 16,
|
||||
"type": "Bytes",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"info": "Null",
|
||||
"lookupIndex": 10,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Result",
|
||||
"lookupIndex": 25,
|
||||
"type": "Result<Option<Bytes>, Null>",
|
||||
"docs": [],
|
||||
"namespace": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Option",
|
||||
"lookupIndex": 26,
|
||||
"type": "Option<Bytes>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 16,
|
||||
"type": "Bytes",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"info": "Null",
|
||||
"lookupIndex": 10,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Option",
|
||||
"lookupIndex": 26,
|
||||
"type": "Option<Bytes>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 16,
|
||||
"type": "Bytes",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 0,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
@@ -1,6 +0,0 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u256"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "u256",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
@@ -1,28 +0,0 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u256"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "Text"
|
||||
}
|
||||
]
|
||||
@@ -1,422 +0,0 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "i32"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"displayName": "Variant",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "None",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"displayName": "Weekday",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 0
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "Monday",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 1
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "Tuesday",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 2
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "Wednesday",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 3
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "Thursday",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 4
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "Friday",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 5
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "Saturday",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 6
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "Sunday",
|
||||
"type": "Null"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":[\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\",\"Sunday\"]}",
|
||||
"name": "Weekday"
|
||||
},
|
||||
{
|
||||
"displayName": "TupleMaybeSigned",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "i32",
|
||||
"name": "Signed"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "Unsigned"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":{\"Signed\":\"i32\",\"Unsigned\":\"u32\"}}",
|
||||
"name": "TupleMaybeSigned"
|
||||
},
|
||||
{
|
||||
"displayName": "NamedMaybeSigned",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "i32",
|
||||
"name": "value"
|
||||
}
|
||||
],
|
||||
"name": "Signed",
|
||||
"type": "{\"value\":\"i32\"}"
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "value"
|
||||
}
|
||||
],
|
||||
"name": "Unsigned",
|
||||
"type": "{\"value\":\"u32\"}"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":{\"Signed\":\"{\\\"value\\\":\\\"i32\\\"}\",\"Unsigned\":\"{\\\"value\\\":\\\"u32\\\"}\"}}",
|
||||
"name": "NamedMaybeSigned"
|
||||
},
|
||||
{
|
||||
"displayName": "Color",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Red",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Blue",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Green",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Yellow",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "r"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "g"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "b"
|
||||
}
|
||||
],
|
||||
"name": "Rgb",
|
||||
"type": "{\"r\":\"u8\",\"g\":\"u8\",\"b\":\"u8\"}"
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "r"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "g"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "b"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "a"
|
||||
}
|
||||
],
|
||||
"name": "Rgba",
|
||||
"type": "{\"r\":\"u8\",\"g\":\"u8\",\"b\":\"u8\",\"a\":\"u8\"}"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":{\"Red\":\"()\",\"Blue\":\"()\",\"Green\":\"()\",\"Yellow\":\"()\",\"Rgb\":\"{\\\"r\\\":\\\"u8\\\",\\\"g\\\":\\\"u8\\\",\\\"b\\\":\\\"u8\\\"}\",\"Rgba\":\"{\\\"r\\\":\\\"u8\\\",\\\"g\\\":\\\"u8\\\",\\\"b\\\":\\\"u8\\\",\\\"a\\\":\\\"u8\\\"}\"}}",
|
||||
"name": "Color"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":{\"None\":\"()\",\"Weekday\":\"Weekday\",\"TupleMaybeSigned\":\"TupleMaybeSigned\",\"NamedMaybeSigned\":\"NamedMaybeSigned\",\"Color\":\"Color\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "Weekday",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 0
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "Monday",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 1
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "Tuesday",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 2
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "Wednesday",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 3
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "Thursday",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 4
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "Friday",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 5
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "Saturday",
|
||||
"type": "Null"
|
||||
},
|
||||
{
|
||||
"ext": {
|
||||
"discriminant": 6
|
||||
},
|
||||
"info": "Plain",
|
||||
"name": "Sunday",
|
||||
"type": "Null"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":[\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\",\"Sunday\"]}"
|
||||
},
|
||||
{
|
||||
"displayName": "TupleMaybeSigned",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "i32",
|
||||
"name": "Signed"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "Unsigned"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":{\"Signed\":\"i32\",\"Unsigned\":\"u32\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "NamedMaybeSigned",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "i32",
|
||||
"name": "value"
|
||||
}
|
||||
],
|
||||
"name": "Signed",
|
||||
"type": "{\"value\":\"i32\"}"
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "value"
|
||||
}
|
||||
],
|
||||
"name": "Unsigned",
|
||||
"type": "{\"value\":\"u32\"}"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":{\"Signed\":\"{\\\"value\\\":\\\"i32\\\"}\",\"Unsigned\":\"{\\\"value\\\":\\\"u32\\\"}\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "Color",
|
||||
"namespace": "enum_example::enum_example",
|
||||
"info": "Enum",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Red",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Blue",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Green",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [],
|
||||
"name": "Yellow",
|
||||
"type": "()"
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "r"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "g"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "b"
|
||||
}
|
||||
],
|
||||
"name": "Rgb",
|
||||
"type": "{\"r\":\"u8\",\"g\":\"u8\",\"b\":\"u8\"}"
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "r"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "g"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "b"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8",
|
||||
"name": "a"
|
||||
}
|
||||
],
|
||||
"name": "Rgba",
|
||||
"type": "{\"r\":\"u8\",\"g\":\"u8\",\"b\":\"u8\",\"a\":\"u8\"}"
|
||||
}
|
||||
],
|
||||
"type": "{\"_enum\":{\"Red\":\"()\",\"Blue\":\"()\",\"Green\":\"()\",\"Yellow\":\"()\",\"Rgb\":\"{\\\"r\\\":\\\"u8\\\",\\\"g\\\":\\\"u8\\\",\\\"b\\\":\\\"u8\\\"}\",\"Rgba\":\"{\\\"r\\\":\\\"u8\\\",\\\"g\\\":\\\"u8\\\",\\\"b\\\":\\\"u8\\\",\\\"a\\\":\\\"u8\\\"}\"}}"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,54 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "u256",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 3,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 4,
|
||||
"lookupName": "AccountId",
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "Text",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
303
packages/api-contract/test/compare/user_v0_enumExample.test.json
Normal file
303
packages/api-contract/test/compare/user_v0_enumExample.test.json
Normal file
@@ -0,0 +1,303 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "i32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 4,
|
||||
"lookupName": "EnumExampleEnumExampleVariant",
|
||||
"type": "{\"_enum\":{\"None\":\"Null\",\"Weekday\":\"EnumExampleEnumExampleWeekday\",\"TupleMaybeSigned\":\"EnumExampleEnumExampleTupleMaybeSigned\",\"NamedMaybeSigned\":\"EnumExampleEnumExampleNamedMaybeSigned\",\"Color\":\"EnumExampleEnumExampleColor\"}}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::Variant",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "None"
|
||||
},
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 5,
|
||||
"lookupName": "EnumExampleEnumExampleWeekday",
|
||||
"type": "Lookup5",
|
||||
"index": 1,
|
||||
"name": "Weekday"
|
||||
},
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 6,
|
||||
"lookupName": "EnumExampleEnumExampleTupleMaybeSigned",
|
||||
"type": "Lookup6",
|
||||
"index": 2,
|
||||
"name": "TupleMaybeSigned"
|
||||
},
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 7,
|
||||
"lookupName": "EnumExampleEnumExampleNamedMaybeSigned",
|
||||
"type": "Lookup7",
|
||||
"index": 3,
|
||||
"name": "NamedMaybeSigned"
|
||||
},
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "EnumExampleEnumExampleColor",
|
||||
"type": "Lookup8",
|
||||
"index": 4,
|
||||
"name": "Color"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 5,
|
||||
"lookupName": "EnumExampleEnumExampleWeekday",
|
||||
"type": "{\"_enum\":[\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\",\"Sunday\"]}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::Weekday",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "Monday"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 1,
|
||||
"name": "Tuesday"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 2,
|
||||
"name": "Wednesday"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 3,
|
||||
"name": "Thursday"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 4,
|
||||
"name": "Friday"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 5,
|
||||
"name": "Saturday"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 6,
|
||||
"name": "Sunday"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 6,
|
||||
"lookupName": "EnumExampleEnumExampleTupleMaybeSigned",
|
||||
"type": "{\"_enum\":{\"Signed\":\"i32\",\"Unsigned\":\"u32\"}}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::TupleMaybeSigned",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "i32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"index": 0,
|
||||
"name": "Signed"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"index": 1,
|
||||
"name": "Unsigned"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 7,
|
||||
"lookupName": "EnumExampleEnumExampleNamedMaybeSigned",
|
||||
"type": "{\"_enum\":{\"Signed\":\"{\\\"value\\\":\\\"i32\\\"}\",\"Unsigned\":\"{\\\"value\\\":\\\"u32\\\"}\"}}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::NamedMaybeSigned",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "i32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
}
|
||||
],
|
||||
"type": "{\"value\":\"i32\"}",
|
||||
"index": 0,
|
||||
"name": "Signed"
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
}
|
||||
],
|
||||
"type": "{\"value\":\"u32\"}",
|
||||
"index": 1,
|
||||
"name": "Unsigned"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "EnumExampleEnumExampleColor",
|
||||
"type": "{\"_enum\":{\"Red\":\"Null\",\"Blue\":\"Null\",\"Green\":\"Null\",\"Yellow\":\"Null\",\"Rgb\":\"{\\\"r\\\":\\\"u8\\\",\\\"g\\\":\\\"u8\\\",\\\"b\\\":\\\"u8\\\"}\",\"Rgba\":\"{\\\"r\\\":\\\"u8\\\",\\\"g\\\":\\\"u8\\\",\\\"b\\\":\\\"u8\\\",\\\"a\\\":\\\"u8\\\"}\"}}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::Color",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "Red"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 1,
|
||||
"name": "Blue"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 2,
|
||||
"name": "Green"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 3,
|
||||
"name": "Yellow"
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "r"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "g"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "b"
|
||||
}
|
||||
],
|
||||
"type": "{\"r\":\"u8\",\"g\":\"u8\",\"b\":\"u8\"}",
|
||||
"index": 4,
|
||||
"name": "Rgb"
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "r"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "g"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "b"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "a"
|
||||
}
|
||||
],
|
||||
"type": "{\"r\":\"u8\",\"g\":\"u8\",\"b\":\"u8\",\"a\":\"u8\"}",
|
||||
"index": 5,
|
||||
"name": "Rgba"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,26 @@
|
||||
[
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 1,
|
||||
"lookupName": "RecursiveMyEnum",
|
||||
"type": "{\"_enum\":{\"A\":\"Null\",\"B\":\"RecursiveMyEnum\"}}",
|
||||
"docs": [],
|
||||
"namespace": "recursive::MyEnum",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "A"
|
||||
},
|
||||
{
|
||||
"info": "Si",
|
||||
"lookupIndex": 1,
|
||||
"lookupName": "RecursiveMyEnum",
|
||||
"type": "Lookup1",
|
||||
"index": 1,
|
||||
"name": "B"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
259
packages/api-contract/test/compare/user_v0_withString.test.json
Normal file
259
packages/api-contract/test/compare/user_v0_withString.test.json
Normal file
@@ -0,0 +1,259 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 2,
|
||||
"lookupName": "InkStorageCollectionsStashHeader",
|
||||
"type": "{\"lastVacant\":\"u32\",\"len\":\"u32\",\"lenEntries\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Header",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lastVacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lenEntries"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 4,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"AccountId\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 6,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::VacantEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "prev"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 9,
|
||||
"lookupName": "InkStorageCollectionsHashmapValueEntry",
|
||||
"type": "{\"value\":\"u128\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 10,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 11,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
],
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 11,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 12,
|
||||
"type": "Text",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 13,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Option",
|
||||
"lookupIndex": 14,
|
||||
"type": "Option<AccountId>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -1,205 +0,0 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u128"
|
||||
},
|
||||
{
|
||||
"displayName": "Header",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "last_vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "len_entries"
|
||||
}
|
||||
],
|
||||
"type": "{\"last_vacant\":\"u32\",\"len\":\"u32\",\"len_entries\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"displayName": "Entry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"AccountId\"}}"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
"type": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u8"
|
||||
},
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"displayName": "ValueEntry",
|
||||
"namespace": "ink_storage::collections::hashmap",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u128",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "key_index"
|
||||
}
|
||||
],
|
||||
"info": "Struct",
|
||||
"type": "{\"value\":\"u128\",\"key_index\":\"u32\"}"
|
||||
},
|
||||
{
|
||||
"displayName": "Entry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "VacantEntry",
|
||||
"namespace": "ink_storage::collections::stash",
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "u32",
|
||||
"name": "prev"
|
||||
}
|
||||
],
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
"type": "(AccountId,AccountId)",
|
||||
"name": "Occupied"
|
||||
}
|
||||
],
|
||||
"info": "Enum",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"VacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"sub": [
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
{
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
}
|
||||
],
|
||||
"type": "(AccountId,AccountId)"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "Text"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"displayName": "Option",
|
||||
"sub": {
|
||||
"displayName": "AccountId",
|
||||
"namespace": "ink_env::types",
|
||||
"info": "Plain",
|
||||
"type": "AccountId"
|
||||
},
|
||||
"info": "Option",
|
||||
"type": "Option<AccountId>"
|
||||
}
|
||||
]
|
||||
@@ -1,9 +1,9 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import * as ink from './ink';
|
||||
import * as solang from './solang';
|
||||
import * as user from './user';
|
||||
import ink from './ink';
|
||||
import solang from './solang';
|
||||
import user from './user';
|
||||
|
||||
const all: Record<string, any> = {};
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as delegator } from './delegator.json';
|
||||
export { default as dns } from './dns.json';
|
||||
export { default as erc20 } from './erc20.json';
|
||||
export { default as erc721 } from './erc721.json';
|
||||
export { default as flipper } from './flipper.json';
|
||||
export { default as flipperBundle } from './flipper.contract.json';
|
||||
export { default as incrementer } from './incrementer.json';
|
||||
export { default as multisigPlain } from './multisig_plain.json';
|
||||
import { createVersionedExport } from '../util';
|
||||
import * as v0 from './v0';
|
||||
import * as v1 from './v1';
|
||||
|
||||
const exp = createVersionedExport('v0', v0, {});
|
||||
|
||||
export default createVersionedExport('v1', v1, exp);
|
||||
|
||||
11
packages/api-contract/test/contracts/ink/v0/index.ts
Normal file
11
packages/api-contract/test/contracts/ink/v0/index.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as delegator } from './delegator.json';
|
||||
export { default as dns } from './dns.json';
|
||||
export { default as erc20 } from './erc20.json';
|
||||
export { default as erc721 } from './erc721.json';
|
||||
export { default as flipper } from './flipper.json';
|
||||
export { default as flipperBundle } from './flipper.contract.json';
|
||||
export { default as incrementer } from './incrementer.json';
|
||||
export { default as multisigPlain } from './multisig_plain.json';
|
||||
@@ -0,0 +1,111 @@
|
||||
{
|
||||
"source": {
|
||||
"hash": "0x7c5ff777929185b2350605e8f0163bfa25781097ad9ee2704c67021962720135",
|
||||
"language": "ink! 3.0.0-rc5",
|
||||
"compiler": "rustc 1.57.0-nightly",
|
||||
"wasm": "0x0061736d01000000012b0860027f7f0060037f7f7f0060017f017f60000060037f7f7f017f60017f0060047f7f7f7f0060017f017e02880106057365616c30107365616c5f6765745f73746f726167650004057365616c30107365616c5f7365745f73746f726167650001057365616c30167365616c5f76616c75655f7472616e736665727265640000057365616c300a7365616c5f696e7075740000057365616c300b7365616c5f72657475726e000103656e76066d656d6f727902010210030e0d020002000100070603020304050608017f01418080040b071102066465706c6f79000d0463616c6c000f0ac60f0dc60101017f230041406a22012400200141206a200041186a290300370300200141186a200041106a290300370300200141106a200041086a2903003703002001420137032820012000290300370308200141808001360234200141808004360230200141808001360238200141086a41808004200141386a10002100200141306a2001280238100602400240024020000e0402000001000b000b000b20012001290330370338200141386a100741ff017122004102470440200141406b240020004100470f0b000b3101017f230041106b22022400200241086a200120002802002000280204100c20002002290308370200200241106a24000b4201027f230041106b22012400200141086a2000100a20012d0009210020012d00082102200141106a240041024101410220004101461b410020001b20024101711b0b8d0101017f230041406a22022400200241206a200141186a290300370300200241186a200141106a290300370300200241106a200141086a2903003703002002420137032820022001290300370308200241386a41808001360200200241808004360234200241003602302002200241306a20001009200241086a200228020020022802041001200241406b24000b9d0101037f230041106b22032400200141086a220428020021052004410036020020012802042104200141808004360204200320023a000f2003410120042005100c024020032802044101460440200328020020032d000f3a0000200141003602082001418080043602042005450d012001200541016b3602082001200441016a3602042000410136020420002004360200200341106a24000f0b000b000b3f01027f230041106b22022400200241003a000f200020012002410f6a410110102201047f41000520022d000f0b3a0001200020013a0000200241106a24000b900102027f017e230041106b220124002001420037030841042102027f02400340200241084604402001410436020820012903082203a741044f0d02000b20012000100a20012d0000410171450440200141086a20026a20012d00013a0000200241016a21020c010b0b4101210241000c010b410021022003422088a70b2100200141106a24002002ad2000ad420886840b1a00200120034d044020002001360204200020023602000f0b000b11004100100e41ff01714108470440000b0ba80602057f017e230041306b22012400027f02400240200045044020014180800136020c200141808004360208200141086a10112001200129030837031041032100200141106a100b2206a722034101710d02200642ffffffffff1f832206422088a721022006421888a721002006421088a721040240200341087641ff01712203419b01470440200341ed01460d010c030b200441ff017141ae0147200041ff0171419d014772200241de0047720d024103200141106a100741ff0171220020004102461b21000c030b200441ff017141cb0047200041ff0171419d0147720d01410221002002411b470d010c020b20014180800136020c200141808004360208200141086a101120012001290308370310410121020240200141106a100b2206a722054101710440410121000c010b200642ffffffffff1f832206422088a721042006421888a721002006421088a721030240200541087641ff01712205412f470440200541e30047200341ff0171413a4772200041ff017141a50147720d0141002100200441d100470d010c020b200341ff017141860147200041ff017141db0047720d004100210041002102200441d901460d010b41012100410121020b410620000d021a20020440200141286a4200370300200141206a4200370300200141186a420037030020014200370310200141106a1005410173200141106a100841080c030b200141286a4200370300200141206a4200370300200141186a4200370300200142003703102001200141106a10053a0008230041106b220024002000200141086a36020c2000410c6a2802002d00002101230041206b22002400200041186a4180800136020020004180800436021420004100360210200041086a200041106a2001100941002000280208200028020c1004000b410321000b4106200041034622020d001a4106200020021b22004102470440200141286a4200370300200141206a4200370300200141186a4200370300200142003703102000410171200141106a100841080c010b200141286a4200370300200141206a4200370300200141186a4200370300200142003703104100200141106a100841080b200141306a24000ba30102037f017e230041206b2200240020004180800136020420004180800436020020004180800136021041808004200041106a100220002000280210100620002000290300370308200041186a22014200370300200042003703100240200041086a200041106a411010102202047e4200052000290310210320012903000b20038450452002724504404101100e41ff01714108470d01200041206a24000f0b000b000b5701057f200028020422042002492205450440200028020022062107034020022003470440200120036a200320076a2d00003a0000200341016a21030c010b0b2000200420026b3602042000200220066a3602000b20050b3301017f230041106b220124002001200028020436020c20002802002001410c6a10032000200128020c1006200141106a24000b"
|
||||
},
|
||||
"contract": {
|
||||
"name": "flipper",
|
||||
"version": "3.0.0-rc5",
|
||||
"authors": [
|
||||
"Parity Technologies <admin@parity.io>"
|
||||
]
|
||||
},
|
||||
"V1": {
|
||||
"spec": {
|
||||
"constructors": [
|
||||
{
|
||||
"args": [
|
||||
{
|
||||
"name": "init_value",
|
||||
"type": {
|
||||
"displayName": [
|
||||
"bool"
|
||||
],
|
||||
"type": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"docs": [
|
||||
"Creates a new flipper smart contract initialized with the given value."
|
||||
],
|
||||
"name": [
|
||||
"new"
|
||||
],
|
||||
"selector": "0x9bae9d5e"
|
||||
},
|
||||
{
|
||||
"args": [],
|
||||
"docs": [
|
||||
"Creates a new flipper smart contract initialized to `false`."
|
||||
],
|
||||
"name": [
|
||||
"default"
|
||||
],
|
||||
"selector": "0xed4b9d1b"
|
||||
}
|
||||
],
|
||||
"docs": [],
|
||||
"events": [],
|
||||
"messages": [
|
||||
{
|
||||
"args": [],
|
||||
"docs": [
|
||||
" Flips the current value of the Flipper's boolean."
|
||||
],
|
||||
"mutates": true,
|
||||
"name": [
|
||||
"flip"
|
||||
],
|
||||
"payable": false,
|
||||
"returnType": null,
|
||||
"selector": "0x633aa551"
|
||||
},
|
||||
{
|
||||
"args": [],
|
||||
"docs": [
|
||||
" Returns the current value of the Flipper's boolean."
|
||||
],
|
||||
"mutates": false,
|
||||
"name": [
|
||||
"get"
|
||||
],
|
||||
"payable": false,
|
||||
"returnType": {
|
||||
"displayName": [
|
||||
"bool"
|
||||
],
|
||||
"type": 0
|
||||
},
|
||||
"selector": "0x2f865bd9"
|
||||
}
|
||||
]
|
||||
},
|
||||
"storage": {
|
||||
"struct": {
|
||||
"fields": [
|
||||
{
|
||||
"layout": {
|
||||
"cell": {
|
||||
"key": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"ty": 0
|
||||
}
|
||||
},
|
||||
"name": "value"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"types": [
|
||||
{
|
||||
"id": 0,
|
||||
"type": {
|
||||
"def": {
|
||||
"primitive": "bool"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
4
packages/api-contract/test/contracts/ink/v1/index.ts
Normal file
4
packages/api-contract/test/contracts/ink/v1/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as flipper } from './flipper.contract.json';
|
||||
@@ -1,4 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as ints256 } from './ints256.json';
|
||||
import { createVersionedExport } from '../util';
|
||||
import * as v0 from './v0';
|
||||
|
||||
export default createVersionedExport('v0', v0, {});
|
||||
|
||||
4
packages/api-contract/test/contracts/solang/v0/index.ts
Normal file
4
packages/api-contract/test/contracts/solang/v0/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as ints256 } from './ints256.json';
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as assetTransfer } from './assetTransfer.json';
|
||||
export { default as enumExample } from './enumExample.json';
|
||||
export { default as withString } from './withString.json';
|
||||
import { createVersionedExport } from '../util';
|
||||
import * as v0 from './v0';
|
||||
|
||||
export default createVersionedExport('v0', v0, {});
|
||||
|
||||
7
packages/api-contract/test/contracts/user/v0/index.ts
Normal file
7
packages/api-contract/test/contracts/user/v0/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as assetTransfer } from './assetTransfer.json';
|
||||
export { default as enumExample } from './enumExample.json';
|
||||
export { default as recursive } from './recursive.contract.json';
|
||||
export { default as withString } from './withString.json';
|
||||
File diff suppressed because one or more lines are too long
10
packages/api-contract/test/contracts/util.ts
Normal file
10
packages/api-contract/test/contracts/util.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export function createVersionedExport (version: string, orig: Record<string, unknown>, exp: Record<string, unknown>): Record<string, unknown> {
|
||||
Object.entries(orig).forEach(([name, json]): void => {
|
||||
exp[`${version}_${name}`] = json;
|
||||
});
|
||||
|
||||
return exp;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api-derive",
|
||||
"version": "6.3.1",
|
||||
"version": "6.4.2",
|
||||
"type": "module",
|
||||
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
|
||||
"main": "index.js",
|
||||
@@ -20,15 +20,15 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/api": "6.3.1",
|
||||
"@polkadot/rpc-core": "6.3.1",
|
||||
"@polkadot/types": "6.3.1",
|
||||
"@polkadot/util": "^7.4.1",
|
||||
"@polkadot/util-crypto": "^7.4.1",
|
||||
"@polkadot/api": "6.4.2",
|
||||
"@polkadot/rpc-core": "6.4.2",
|
||||
"@polkadot/types": "6.4.2",
|
||||
"@polkadot/util": "^7.5.1",
|
||||
"@polkadot/util-crypto": "^7.5.1",
|
||||
"rxjs": "^7.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^7.4.1",
|
||||
"@polkadot/rpc-provider": "6.3.1"
|
||||
"@polkadot/keyring": "^7.5.1",
|
||||
"@polkadot/rpc-provider": "6.4.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ function queryAccounts (api: ApiInterfaceRx): Observable<AccountIndexes> {
|
||||
map((entries): AccountIndexes =>
|
||||
entries.reduce((indexes: AccountIndexes, [key, idOpt]): AccountIndexes => {
|
||||
if (idOpt.isSome) {
|
||||
indexes[idOpt.unwrap()[0].toString()] = key.args[0];
|
||||
indexes[idOpt.unwrap()[0].toString()] = api.registry.createType('AccountIndex', key.args[0]);
|
||||
}
|
||||
|
||||
return indexes;
|
||||
|
||||
@@ -6,17 +6,17 @@ import type { ApiInterfaceRx, QueryableStorageMultiArg } from '@polkadot/api/typ
|
||||
import type { Option, Vec } from '@polkadot/types';
|
||||
import type { AccountId, AccountIndex, Address, Balance, BalanceLockTo212, BlockNumber, VestingSchedule } from '@polkadot/types/interfaces';
|
||||
import type { PalletBalancesBalanceLock, PalletVestingVestingInfo } from '@polkadot/types/lookup';
|
||||
import type { DeriveBalancesAccount, DeriveBalancesAccountData, DeriveBalancesAll, DeriveBalancesAllAccountData } from '../types';
|
||||
import type { DeriveBalancesAccount, DeriveBalancesAccountData, DeriveBalancesAll, DeriveBalancesAllAccountData, DeriveBalancesAllVesting } from '../types';
|
||||
|
||||
import { combineLatest, map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { BN, bnMax, isFunction } from '@polkadot/util';
|
||||
import { BN, BN_ZERO, bnMax, bnMin, isFunction } from '@polkadot/util';
|
||||
|
||||
import { memo } from '../util';
|
||||
|
||||
type BalanceLocksEntry = Vec<PalletBalancesBalanceLock | BalanceLockTo212>;
|
||||
type BalanceLocks = BalanceLocksEntry[];
|
||||
type ResultBalance = [PalletVestingVestingInfo | null, ((PalletBalancesBalanceLock | BalanceLockTo212)[])[]];
|
||||
type ResultBalance = [PalletVestingVestingInfo[] | null, ((PalletBalancesBalanceLock | BalanceLockTo212)[])[]];
|
||||
type Result = [DeriveBalancesAccount, BlockNumber, ResultBalance];
|
||||
|
||||
interface AllLocked {
|
||||
@@ -69,29 +69,48 @@ function calcShared (api: ApiInterfaceRx, bestNumber: BlockNumber, data: DeriveB
|
||||
};
|
||||
}
|
||||
|
||||
function calcBalances (api: ApiInterfaceRx, [data, bestNumber, [vesting, allLocks]]: Result): DeriveBalancesAll {
|
||||
const shared = calcShared(api, bestNumber, data, allLocks[0]);
|
||||
function calcVesting (bestNumber: BlockNumber, shared: DeriveBalancesAllAccountData, _vesting: PalletVestingVestingInfo[] | null): DeriveBalancesAllVesting {
|
||||
// Calculate the vesting balances,
|
||||
// - offset = balance locked at startingBlock
|
||||
// - perBlock is the unlock amount
|
||||
const emptyVest = api.registry.createType<PalletVestingVestingInfo>('VestingInfo');
|
||||
const { locked: vestingTotal, perBlock, startingBlock } = vesting || emptyVest;
|
||||
const isStarted = bestNumber.gt(startingBlock);
|
||||
const vestedNow = isStarted ? perBlock.mul(bestNumber.sub(startingBlock)) : new BN(0);
|
||||
const vestedBalance = vestedNow.gt(vestingTotal) ? vestingTotal : api.registry.createType('Balance', vestedNow);
|
||||
const isVesting = isStarted && !shared.vestingLocked.isZero();
|
||||
const vesting = _vesting || [];
|
||||
const isVesting = !shared.vestingLocked.isZero();
|
||||
const vestedBalances = vesting.map(({ locked, perBlock, startingBlock }) =>
|
||||
bestNumber.gt(startingBlock)
|
||||
? bnMin(locked, perBlock.mul(bestNumber.sub(startingBlock)))
|
||||
: BN_ZERO
|
||||
);
|
||||
const vestedBalance = vestedBalances.reduce<BN>((all, value) => all.iadd(value), new BN(0));
|
||||
const vestingTotal = vesting.reduce<BN>((all, { locked }) => all.iadd(locked), new BN(0));
|
||||
|
||||
return {
|
||||
isVesting,
|
||||
vestedBalance,
|
||||
vestedClaimable: isVesting ? shared.vestingLocked.sub(vestingTotal.sub(vestedBalance)) : BN_ZERO,
|
||||
vesting: vesting
|
||||
.map(({ locked, perBlock, startingBlock }, index) => ({
|
||||
endBlock: locked.div(perBlock).iadd(startingBlock),
|
||||
locked,
|
||||
perBlock,
|
||||
startingBlock,
|
||||
vested: vestedBalances[index]
|
||||
}))
|
||||
.filter(({ locked }) => !locked.isZero()),
|
||||
vestingTotal
|
||||
};
|
||||
}
|
||||
|
||||
function calcBalances (api: ApiInterfaceRx, [data, bestNumber, [vesting, allLocks]]: Result): DeriveBalancesAll {
|
||||
const shared = calcShared(api, bestNumber, data, allLocks[0]);
|
||||
|
||||
return {
|
||||
...shared,
|
||||
...calcVesting(bestNumber, shared, vesting),
|
||||
accountId: data.accountId,
|
||||
accountNonce: data.accountNonce,
|
||||
additional: allLocks.filter((_, index) => index !== 0).map((l, index) => calcShared(api, bestNumber, data.additional[index], l)),
|
||||
isVesting,
|
||||
vestedBalance,
|
||||
vestedClaimable: api.registry.createType('Balance', isVesting ? shared.vestingLocked.sub(vestingTotal.sub(vestedBalance)) : 0),
|
||||
vestingEndBlock: api.registry.createType('BlockNumber', isVesting ? vestingTotal.div(perBlock).add(startingBlock) : 0),
|
||||
vestingPerBlock: perBlock,
|
||||
vestingTotal
|
||||
additional: allLocks
|
||||
.filter((_, index) => index !== 0)
|
||||
.map((l, index) => calcShared(api, bestNumber, data.additional[index], l))
|
||||
};
|
||||
}
|
||||
|
||||
@@ -110,7 +129,12 @@ function queryOld (api: ApiInterfaceRx, accountId: AccountId): Observable<Result
|
||||
vestingNew = api.registry.createType<PalletVestingVestingInfo>('VestingInfo', { locked, perBlock, startingBlock });
|
||||
}
|
||||
|
||||
return [vestingNew, [locks]];
|
||||
return [
|
||||
vestingNew
|
||||
? [vestingNew]
|
||||
: null,
|
||||
[locks]
|
||||
];
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -127,7 +151,7 @@ function queryCurrent (api: ApiInterfaceRx, accountId: AccountId, balanceInstanc
|
||||
|
||||
return (
|
||||
api.query.vesting?.vesting
|
||||
? api.queryMulti<[Option<PalletVestingVestingInfo>, ...BalanceLocks]>([[api.query.vesting.vesting, accountId], ...queries])
|
||||
? api.queryMulti<[Option<PalletVestingVestingInfo> | Option<Vec<PalletVestingVestingInfo>>, ...BalanceLocks]>([[api.query.vesting.vesting, accountId], ...queries])
|
||||
// TODO We need to check module instances here as well, not only the balances module
|
||||
: queries.length
|
||||
? api.queryMulti<[...(Vec<PalletBalancesBalanceLock>)[]]>(queries).pipe(
|
||||
@@ -137,9 +161,14 @@ function queryCurrent (api: ApiInterfaceRx, accountId: AccountId, balanceInstanc
|
||||
).pipe(
|
||||
map(([opt, ...locks]): ResultBalance => {
|
||||
let offset = -1;
|
||||
const vesting = opt.unwrapOr(null);
|
||||
|
||||
return [
|
||||
opt.unwrapOr(null),
|
||||
vesting
|
||||
? Array.isArray(vesting)
|
||||
? vesting
|
||||
: [vesting]
|
||||
: null,
|
||||
lockEmpty.map((e) => e ? api.registry.createType<Vec<PalletBalancesBalanceLock>>('Vec<BalanceLock>') : locks[++offset])
|
||||
];
|
||||
})
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AccountId, Balance, BalanceLockTo212, BlockNumber, Index } from '@polkadot/types/interfaces';
|
||||
import type { AccountId, Balance, BalanceLockTo212, Index } from '@polkadot/types/interfaces';
|
||||
import type { PalletBalancesBalanceLock } from '@polkadot/types/lookup';
|
||||
import type { BN } from '@polkadot/util';
|
||||
|
||||
export interface DeriveBalancesAccountData {
|
||||
freeBalance: Balance;
|
||||
@@ -25,14 +26,24 @@ export interface DeriveBalancesAllAccountData extends DeriveBalancesAccountData
|
||||
vestingLocked: Balance;
|
||||
}
|
||||
|
||||
export interface DeriveBalancesAll extends DeriveBalancesAccount, DeriveBalancesAllAccountData {
|
||||
additional: DeriveBalancesAllAccountData[];
|
||||
export interface DeriveBalancesVesting {
|
||||
startingBlock: BN;
|
||||
endBlock: BN;
|
||||
perBlock: BN;
|
||||
locked: BN;
|
||||
vested: BN;
|
||||
}
|
||||
|
||||
export interface DeriveBalancesAllVesting {
|
||||
isVesting: boolean;
|
||||
vestedBalance: Balance;
|
||||
vestedClaimable: Balance;
|
||||
vestingEndBlock: BlockNumber;
|
||||
vestingPerBlock: Balance;
|
||||
vestingTotal: Balance;
|
||||
vestedBalance: BN;
|
||||
vestedClaimable: BN;
|
||||
vesting: DeriveBalancesVesting[];
|
||||
vestingTotal: BN;
|
||||
}
|
||||
|
||||
export interface DeriveBalancesAll extends DeriveBalancesAccount, DeriveBalancesAllAccountData, DeriveBalancesAllVesting {
|
||||
additional: DeriveBalancesAllAccountData[];
|
||||
}
|
||||
|
||||
export type DeriveBalancesMap = Record<string, DeriveBalancesAll>;
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { Option } from '@polkadot/types';
|
||||
import type { FundInfo, ParaId } from '@polkadot/types/interfaces';
|
||||
import type { PolkadotRuntimeCommonCrowdloanFundInfo } from '@polkadot/types/lookup';
|
||||
import type { BN } from '@polkadot/util';
|
||||
|
||||
import { map } from 'rxjs';
|
||||
|
||||
@@ -13,7 +14,7 @@ import { blake2AsU8a } from '@polkadot/util-crypto';
|
||||
|
||||
import { memo } from '../util';
|
||||
|
||||
function createChildKey ({ trieIndex }: FundInfo): string {
|
||||
function createChildKey ({ trieIndex }: PolkadotRuntimeCommonCrowdloanFundInfo): string {
|
||||
return u8aToHex(
|
||||
u8aConcat(
|
||||
':child_storage:default:',
|
||||
@@ -24,9 +25,9 @@ function createChildKey ({ trieIndex }: FundInfo): string {
|
||||
);
|
||||
}
|
||||
|
||||
export function childKey (instanceId: string, api: ApiInterfaceRx): (paraId: string | number | ParaId) => Observable<string | null> {
|
||||
return memo(instanceId, (paraId: string | number | ParaId): Observable<string | null> =>
|
||||
api.query.crowdloan.funds<Option<FundInfo>>(paraId).pipe(
|
||||
export function childKey (instanceId: string, api: ApiInterfaceRx): (paraId: string | number | BN) => Observable<string | null> {
|
||||
return memo(instanceId, (paraId: string | number | BN): Observable<string | null> =>
|
||||
api.query.crowdloan.funds<Option<PolkadotRuntimeCommonCrowdloanFundInfo>>(paraId).pipe(
|
||||
map((optInfo) =>
|
||||
optInfo.isSome
|
||||
? createChildKey(optInfo.unwrap())
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { StorageKey } from '@polkadot/types';
|
||||
import type { ParaId } from '@polkadot/types/interfaces';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { DeriveContributions } from '../types';
|
||||
|
||||
import { BehaviorSubject, combineLatest, EMPTY, map, of, startWith, switchMap, tap, toArray } from 'rxjs';
|
||||
@@ -22,7 +22,7 @@ interface Changes {
|
||||
|
||||
const PAGE_SIZE_K = 1000; // limit aligned with the 1k on the node (trie lookups are heavy)
|
||||
|
||||
function _getUpdates (api: ApiInterfaceRx, paraId: string | number | ParaId): Observable<Changes> {
|
||||
function _getUpdates (api: ApiInterfaceRx, paraId: string | number | BN): Observable<Changes> {
|
||||
let added: string[] = [];
|
||||
let removed: string[] = [];
|
||||
|
||||
@@ -43,7 +43,7 @@ function _getUpdates (api: ApiInterfaceRx, paraId: string | number | ParaId): Ob
|
||||
);
|
||||
}
|
||||
|
||||
function _eventTriggerAll (api: ApiInterfaceRx, paraId: string | number | ParaId): Observable<string> {
|
||||
function _eventTriggerAll (api: ApiInterfaceRx, paraId: string | number | BN): Observable<string> {
|
||||
return api.query.system.events().pipe(
|
||||
switchMap((events): Observable<string> => {
|
||||
const items = events.filter(({ event: { data: [eventParaId], method, section } }) =>
|
||||
@@ -79,12 +79,10 @@ function _getKeysPaged (api: ApiInterfaceRx, childKey: string): Observable<Stora
|
||||
);
|
||||
}
|
||||
|
||||
function _getAll (api: ApiInterfaceRx, paraId: string | number | ParaId, childKey: string): Observable<string[]> {
|
||||
function _getAll (api: ApiInterfaceRx, paraId: string | number | BN, childKey: string): Observable<string[]> {
|
||||
return _eventTriggerAll(api, paraId).pipe(
|
||||
switchMap(() =>
|
||||
// FIXME Needs testing and being enabled
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
isFunction(api.rpc.childstate.getKeysPaged) && false
|
||||
isFunction(api.rpc.childstate.getKeysPaged)
|
||||
? _getKeysPaged(api, childKey)
|
||||
: api.rpc.childstate.getKeys(childKey, '0x')
|
||||
),
|
||||
@@ -94,7 +92,7 @@ function _getAll (api: ApiInterfaceRx, paraId: string | number | ParaId, childKe
|
||||
);
|
||||
}
|
||||
|
||||
function _contributions (api: ApiInterfaceRx, paraId: string | number | ParaId, childKey: string): Observable<DeriveContributions> {
|
||||
function _contributions (api: ApiInterfaceRx, paraId: string | number | BN, childKey: string): Observable<DeriveContributions> {
|
||||
return combineLatest([
|
||||
_getAll(api, paraId, childKey),
|
||||
_getUpdates(api, paraId)
|
||||
@@ -122,8 +120,8 @@ function _contributions (api: ApiInterfaceRx, paraId: string | number | ParaId,
|
||||
);
|
||||
}
|
||||
|
||||
export function contributions (instanceId: string, api: ApiInterfaceRx): (paraId: string | number | ParaId) => Observable<DeriveContributions> {
|
||||
return memo(instanceId, (paraId: string | number | ParaId): Observable<DeriveContributions> =>
|
||||
export function contributions (instanceId: string, api: ApiInterfaceRx): (paraId: string | number | BN) => Observable<DeriveContributions> {
|
||||
return memo(instanceId, (paraId: string | number | BN): Observable<DeriveContributions> =>
|
||||
api.derive.crowdloan.childKey(paraId).pipe(
|
||||
switchMap((childKey) =>
|
||||
childKey
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { ParaId } from '@polkadot/types/interfaces';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { DeriveOwnContributions } from '../types';
|
||||
|
||||
import { combineLatest, EMPTY, map, of, startWith, switchMap } from 'rxjs';
|
||||
@@ -30,7 +30,7 @@ function _getValues (api: ApiInterfaceRx, childKey: string, keys: string[]): Obs
|
||||
);
|
||||
}
|
||||
|
||||
function _watchOwnChanges (api: ApiInterfaceRx, paraId: string | number | ParaId, childkey: string, keys: string[]): Observable<DeriveOwnContributions> {
|
||||
function _watchOwnChanges (api: ApiInterfaceRx, paraId: string | number | BN, childkey: string, keys: string[]): Observable<DeriveOwnContributions> {
|
||||
return api.query.system.events().pipe(
|
||||
switchMap((events): Observable<DeriveOwnContributions> => {
|
||||
const changes = extractContributed(paraId, events);
|
||||
@@ -47,7 +47,7 @@ function _watchOwnChanges (api: ApiInterfaceRx, paraId: string | number | ParaId
|
||||
);
|
||||
}
|
||||
|
||||
function _contributions (api: ApiInterfaceRx, paraId: string | number | ParaId, childKey: string, keys: string[]): Observable<DeriveOwnContributions> {
|
||||
function _contributions (api: ApiInterfaceRx, paraId: string | number | BN, childKey: string, keys: string[]): Observable<DeriveOwnContributions> {
|
||||
return combineLatest([
|
||||
_getValues(api, childKey, keys),
|
||||
_watchOwnChanges(api, paraId, childKey, keys)
|
||||
@@ -59,8 +59,8 @@ function _contributions (api: ApiInterfaceRx, paraId: string | number | ParaId,
|
||||
);
|
||||
}
|
||||
|
||||
export function ownContributions (instanceId: string, api: ApiInterfaceRx): (paraId: string | number | ParaId, keys: string[]) => Observable<DeriveOwnContributions> {
|
||||
return memo(instanceId, (paraId: string | number | ParaId, keys: string[]): Observable<DeriveOwnContributions> =>
|
||||
export function ownContributions (instanceId: string, api: ApiInterfaceRx): (paraId: string | number | BN, keys: string[]) => Observable<DeriveOwnContributions> {
|
||||
return memo(instanceId, (paraId: string | number | BN, keys: string[]): Observable<DeriveOwnContributions> =>
|
||||
api.derive.crowdloan.childKey(paraId).pipe(
|
||||
switchMap((childKey) =>
|
||||
childKey && keys.length
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Vec } from '@polkadot/types';
|
||||
import type { EventRecord, ParaId } from '@polkadot/types/interfaces';
|
||||
import type { EventRecord } from '@polkadot/types/interfaces';
|
||||
import type { BN } from '@polkadot/util';
|
||||
|
||||
interface Changes {
|
||||
added: string[];
|
||||
@@ -10,7 +11,7 @@ interface Changes {
|
||||
removed: string[];
|
||||
}
|
||||
|
||||
export function extractContributed (paraId: string | number | ParaId, events: Vec<EventRecord>): Changes {
|
||||
export function extractContributed (paraId: string | number | BN, events: Vec<EventRecord>): Changes {
|
||||
const added: string[] = [];
|
||||
const removed: string[] = [];
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { u32, Vec } from '@polkadot/types';
|
||||
import type { AccountId, Balance, BlockNumber, SeatHolder } from '@polkadot/types/interfaces';
|
||||
import type { AccountId, Balance, BlockNumber } from '@polkadot/types/interfaces';
|
||||
import type { PalletElectionsPhragmenSeatHolder } from '@polkadot/types/lookup';
|
||||
import type { ITuple } from '@polkadot/types/types';
|
||||
import type { DeriveElectionsInfo } from './types';
|
||||
|
||||
@@ -13,11 +14,11 @@ import { combineLatest, map, of } from 'rxjs';
|
||||
import { memo } from '../util';
|
||||
|
||||
// SeatHolder is current tuple is 2.x-era Substrate
|
||||
type Member = SeatHolder | ITuple<[AccountId, Balance]>;
|
||||
type Member = PalletElectionsPhragmenSeatHolder | ITuple<[AccountId, Balance]>;
|
||||
|
||||
type Candidate = AccountId | ITuple<[AccountId, Balance]>;
|
||||
|
||||
function isSeatHolder (value: Member): value is SeatHolder {
|
||||
function isSeatHolder (value: Member): value is PalletElectionsPhragmenSeatHolder {
|
||||
return !Array.isArray(value);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-derive', version: '6.3.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', version: '6.4.2' };
|
||||
|
||||
@@ -48,7 +48,7 @@ export function stakerExposures (instanceId: string, api: ApiInterfaceRx): (acco
|
||||
|
||||
export function stakerExposure (instanceId: string, api: ApiInterfaceRx): (accountId: Uint8Array | string, withActive?: boolean) => Observable<DeriveStakerExposure[]> {
|
||||
return memo(instanceId, (accountId: Uint8Array | string, withActive = false): Observable<DeriveStakerExposure[]> =>
|
||||
api.derive.staking.stakerExposures([accountId, withActive]).pipe(
|
||||
api.derive.staking.stakerExposures([accountId], withActive).pipe(
|
||||
map(([first]) => first)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { Option } from '@polkadot/types';
|
||||
import type { ProposalIndex, TreasuryProposal } from '@polkadot/types/interfaces';
|
||||
import type { ProposalIndex } from '@polkadot/types/interfaces';
|
||||
import type { PalletTreasuryProposal } from '@polkadot/types/lookup';
|
||||
import type { DeriveCollectiveProposal, DeriveTreasuryProposal, DeriveTreasuryProposals } from '../types';
|
||||
|
||||
import { combineLatest, map, of, switchMap } from 'rxjs';
|
||||
@@ -13,7 +14,7 @@ import { memo } from '../util';
|
||||
|
||||
interface Result {
|
||||
allIds: ProposalIndex[];
|
||||
allProposals: Option<TreasuryProposal>[];
|
||||
allProposals: Option<PalletTreasuryProposal>[];
|
||||
approvalIds: ProposalIndex[];
|
||||
councilProposals: DeriveCollectiveProposal[];
|
||||
proposalCount: ProposalIndex;
|
||||
@@ -64,7 +65,7 @@ function retrieveProposals (api: ApiInterfaceRx, proposalCount: ProposalIndex, a
|
||||
? api.derive.council.proposals()
|
||||
: of([] as DeriveCollectiveProposal[])
|
||||
]).pipe(
|
||||
map(([allProposals, councilProposals]: [Option<TreasuryProposal>[], DeriveCollectiveProposal[]]): DeriveTreasuryProposals =>
|
||||
map(([allProposals, councilProposals]: [Option<PalletTreasuryProposal>[], DeriveCollectiveProposal[]]): DeriveTreasuryProposals =>
|
||||
parseResult(api, { allIds, allProposals, approvalIds, councilProposals, proposalCount })
|
||||
)
|
||||
);
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { u32 } from '@polkadot/types';
|
||||
import type { Balance, BlockNumber, BountyIndex, Hash, Proposal, ProposalIndex, SetIndex, TreasuryProposal, Votes } from '@polkadot/types/interfaces';
|
||||
import type { PalletBountiesBounty } from '@polkadot/types/lookup';
|
||||
import type { Balance, BlockNumber, BountyIndex, Hash, Proposal, ProposalIndex, SetIndex, Votes } from '@polkadot/types/interfaces';
|
||||
import type { PalletBountiesBounty, PalletTreasuryProposal } from '@polkadot/types/lookup';
|
||||
import type { BN } from '@polkadot/util';
|
||||
|
||||
export * from './accounts/types';
|
||||
@@ -63,7 +63,7 @@ export type DeriveRecentlyOffline = Record<string, RecentlyOffline[]>;
|
||||
export interface DeriveTreasuryProposal {
|
||||
council: DeriveCollectiveProposal[];
|
||||
id: ProposalIndex;
|
||||
proposal: TreasuryProposal;
|
||||
proposal: PalletTreasuryProposal;
|
||||
}
|
||||
|
||||
export interface DeriveTreasuryProposals {
|
||||
|
||||
@@ -18,7 +18,7 @@ function wrapCache (keyStart: string, cache: DeriveCache): DeriveCache {
|
||||
return {
|
||||
del: (partial: string): void => cache.del(`${keyStart}${partial}`),
|
||||
forEach: cache.forEach,
|
||||
get: <T = any> (partial: string): T | undefined => {
|
||||
get: <T> (partial: string): T | undefined => {
|
||||
const key = `${keyStart}${partial}`;
|
||||
const cached = cache.get<CacheValue<T>>(key);
|
||||
|
||||
@@ -40,7 +40,7 @@ function wrapCache (keyStart: string, cache: DeriveCache): DeriveCache {
|
||||
function clearCache (cache: DeriveCache): void {
|
||||
// clear all expired values
|
||||
const now = Date.now();
|
||||
const all: any[] = [];
|
||||
const all: string[] = [];
|
||||
|
||||
cache.forEach((key: string, { x }: CacheValue<any>): void => {
|
||||
((now - x) > CHACHE_EXPIRY) && all.push(key);
|
||||
|
||||
@@ -21,5 +21,5 @@ export class ProposalFactory {
|
||||
|
||||
public proposalIndex = (index: number): ProposalIndex => {
|
||||
return this.#registry.createType('ProposalIndex', index);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api",
|
||||
"version": "6.3.1",
|
||||
"version": "6.4.2",
|
||||
"type": "module",
|
||||
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
|
||||
"main": "index.js",
|
||||
@@ -20,14 +20,14 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/api-derive": "6.3.1",
|
||||
"@polkadot/keyring": "^7.4.1",
|
||||
"@polkadot/rpc-core": "6.3.1",
|
||||
"@polkadot/rpc-provider": "6.3.1",
|
||||
"@polkadot/types": "6.3.1",
|
||||
"@polkadot/types-known": "6.3.1",
|
||||
"@polkadot/util": "^7.4.1",
|
||||
"@polkadot/util-crypto": "^7.4.1",
|
||||
"@polkadot/api-derive": "6.4.2",
|
||||
"@polkadot/keyring": "^7.5.1",
|
||||
"@polkadot/rpc-core": "6.4.2",
|
||||
"@polkadot/rpc-provider": "6.4.2",
|
||||
"@polkadot/types": "6.4.2",
|
||||
"@polkadot/types-known": "6.4.2",
|
||||
"@polkadot/util": "^7.5.1",
|
||||
"@polkadot/util-crypto": "^7.5.1",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"rxjs": "^7.4.0"
|
||||
}
|
||||
|
||||
@@ -438,7 +438,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Multiple calls to this method will replace any existing planned config change that had
|
||||
* not been enacted yet.
|
||||
**/
|
||||
planConfigChange: AugmentedSubmittable<(config: SpConsensusBabeDigestsNextConfigDescriptor | { Unused0: any } | { V1: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [SpConsensusBabeDigestsNextConfigDescriptor]>;
|
||||
planConfigChange: AugmentedSubmittable<(config: SpConsensusBabeDigestsNextConfigDescriptor | { V1: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [SpConsensusBabeDigestsNextConfigDescriptor]>;
|
||||
/**
|
||||
* Report authority equivocation/misbehavior. This method will verify
|
||||
* the equivocation proof and validate the given key ownership proof
|
||||
|
||||
@@ -441,7 +441,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
method.is(other);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||
return this._decorateFunctionMeta(method as any, decorated as any) as unknown as SubmittableExtrinsicFunction<ApiType>;
|
||||
return this._decorateFunctionMeta(method as unknown as MetaDecoration, decorated as unknown as MetaDecoration) as unknown as SubmittableExtrinsicFunction<ApiType>;
|
||||
}
|
||||
|
||||
protected _decorateStorage<ApiType extends ApiTypes> ({ query }: DecoratedMeta, decorateMethod: DecorateMethod<ApiType>): QueryableStorage<ApiType> {
|
||||
@@ -479,7 +479,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
// Disable this where it occurs for each field we are decorating
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment */
|
||||
|
||||
const decorated = this._decorateStorageCall(creator, decorateMethod);
|
||||
const decorated: AugmentedQuery<'rxjs', GenericStorageEntryFunction, AnyTuple> & MetaDecoration = this._decorateStorageCall(creator, decorateMethod);
|
||||
|
||||
decorated.creator = creator;
|
||||
|
||||
@@ -551,7 +551,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
|
||||
/* eslint-enable @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment */
|
||||
|
||||
return this._decorateFunctionMeta(creator as any, decorated) as unknown as QueryableStorageEntry<ApiType>;
|
||||
return this._decorateFunctionMeta(creator as unknown as MetaDecoration, decorated) as unknown as QueryableStorageEntry<ApiType>;
|
||||
}
|
||||
|
||||
private _decorateStorageEntryAt<ApiType extends ApiTypes> (registry: Registry, creator: StorageEntry, decorateMethod: DecorateMethod<ApiType>, blockHash: Uint8Array): QueryableStorageEntryAt<ApiType> {
|
||||
@@ -560,7 +560,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
// Disable this where it occurs for each field we are decorating
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment */
|
||||
|
||||
const decorated = decorateMethod((...args: unknown[]): Observable<Codec> =>
|
||||
const decorated: AugmentedQuery<'rxjs', GenericStorageEntryFunction, AnyTuple> & MetaDecoration = decorateMethod((...args: unknown[]): Observable<Codec> =>
|
||||
this._rpcCore.state.getStorage(getArgs(args), blockHash));
|
||||
|
||||
decorated.creator = creator;
|
||||
@@ -598,7 +598,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
|
||||
/* eslint-enable @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment */
|
||||
|
||||
return this._decorateFunctionMeta(creator as any, decorated) as unknown as QueryableStorageEntry<ApiType>;
|
||||
return this._decorateFunctionMeta(creator as unknown as MetaDecoration, decorated) as unknown as QueryableStorageEntry<ApiType>;
|
||||
}
|
||||
|
||||
// Decorate the base storage call. In the case or rxjs or promise-without-callback (await)
|
||||
@@ -735,5 +735,5 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
*/
|
||||
protected _rxDecorateMethod = <Method extends AnyFunction>(method: Method): Method => {
|
||||
return method;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user