Support for ink! v4 metadata (#5195)
* Support for ink! v4 metadata * Adjust * Export v4ToLatest * Adjust expectations
This commit is contained in:
@@ -106,6 +106,7 @@ const spec = {
|
||||
events: 'Vec<ContractEventSpecV2>',
|
||||
docs: 'Vec<Text>'
|
||||
},
|
||||
ContractContractSpecV4: 'ContractContractSpecV3',
|
||||
ContractDisplayName: 'SiPath',
|
||||
ContractEventParamSpecV0: {
|
||||
name: 'Text',
|
||||
@@ -197,6 +198,8 @@ const ContractMetadataV3 = {
|
||||
spec: 'ContractContractSpecV3'
|
||||
};
|
||||
|
||||
const ContractMetadataV4 = ContractMetadataV3;
|
||||
|
||||
const ContractProjectInfo = {
|
||||
source: 'ContractProjectSource',
|
||||
contract: 'ContractProjectContract'
|
||||
@@ -208,7 +211,7 @@ const latest = {
|
||||
ContractEventParamSpecLatest: 'ContractEventParamSpecV2',
|
||||
ContractMessageParamSpecLatest: 'ContractMessageParamSpecV2',
|
||||
ContractMessageSpecLatest: 'ContractMessageSpecV2',
|
||||
ContractMetadataLatest: 'ContractMetadataV3'
|
||||
ContractMetadataLatest: 'ContractMetadataV4'
|
||||
};
|
||||
|
||||
export default {
|
||||
@@ -219,12 +222,14 @@ export default {
|
||||
ContractMetadataV1,
|
||||
ContractMetadataV2,
|
||||
ContractMetadataV3,
|
||||
ContractMetadataV4,
|
||||
ContractMetadata: {
|
||||
_enum: {
|
||||
V0: 'ContractMetadataV0',
|
||||
V1: 'ContractMetadataV1',
|
||||
V2: 'ContractMetadataV2',
|
||||
V3: 'ContractMetadataV3'
|
||||
V3: 'ContractMetadataV3',
|
||||
V4: 'ContractMetadataV4'
|
||||
}
|
||||
},
|
||||
ContractProjectV0: objectSpread({ metadataVersion: 'Text' }, ContractProjectInfo, ContractMetadataV0),
|
||||
|
||||
@@ -74,6 +74,9 @@ export interface ContractContractSpecV3 extends Struct {
|
||||
readonly docs: Vec<Text>;
|
||||
}
|
||||
|
||||
/** @name ContractContractSpecV4 */
|
||||
export interface ContractContractSpecV4 extends ContractContractSpecV3 {}
|
||||
|
||||
/** @name ContractCryptoHasher */
|
||||
export interface ContractCryptoHasher extends Enum {
|
||||
readonly isBlake2x256: boolean;
|
||||
@@ -240,11 +243,13 @@ export interface ContractMetadata extends Enum {
|
||||
readonly asV2: ContractMetadataV2;
|
||||
readonly isV3: boolean;
|
||||
readonly asV3: ContractMetadataV3;
|
||||
readonly type: 'V0' | 'V1' | 'V2' | 'V3';
|
||||
readonly isV4: boolean;
|
||||
readonly asV4: ContractMetadataV4;
|
||||
readonly type: 'V0' | 'V1' | 'V2' | 'V3' | 'V4';
|
||||
}
|
||||
|
||||
/** @name ContractMetadataLatest */
|
||||
export interface ContractMetadataLatest extends ContractMetadataV3 {}
|
||||
export interface ContractMetadataLatest extends ContractMetadataV4 {}
|
||||
|
||||
/** @name ContractMetadataV0 */
|
||||
export interface ContractMetadataV0 extends Struct {
|
||||
@@ -271,6 +276,12 @@ export interface ContractMetadataV3 extends Struct {
|
||||
readonly spec: ContractContractSpecV3;
|
||||
}
|
||||
|
||||
/** @name ContractMetadataV4 */
|
||||
export interface ContractMetadataV4 extends Struct {
|
||||
readonly types: Vec<PortableType>;
|
||||
readonly spec: ContractContractSpecV3;
|
||||
}
|
||||
|
||||
/** @name ContractProject */
|
||||
export interface ContractProject extends ITuple<[ContractProjectInfo, ContractMetadata]> {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user