Update contract types and rpc (#4541)
* Update contract types and rpc * Corrected InstantiateReturnValue * enum, set fallbacks * set definition * underscore
This commit is contained in:
@@ -23,6 +23,12 @@ export default {
|
||||
_reserved: 'Option<Null>'
|
||||
},
|
||||
CodeHash: 'Hash',
|
||||
CodeSource: {
|
||||
_enum: {
|
||||
Upload: 'Bytes',
|
||||
Existing: 'Hash'
|
||||
}
|
||||
},
|
||||
CodeUploadRequest: {
|
||||
origin: 'AccountId',
|
||||
code: 'Bytes',
|
||||
@@ -234,7 +240,16 @@ export default {
|
||||
hashBlake2128PerByte: 'Weight',
|
||||
rentParams: 'Weight'
|
||||
},
|
||||
InstantiateRequest: {
|
||||
InstantiateRequestV1: {
|
||||
origin: 'AccountId',
|
||||
value: 'Balance',
|
||||
gasLimit: 'Gas',
|
||||
code: 'Bytes',
|
||||
data: 'Bytes',
|
||||
salt: 'Bytes'
|
||||
},
|
||||
InstantiateRequestV2: {
|
||||
_fallback: 'InstantiateRequestV1',
|
||||
origin: 'AccountId',
|
||||
value: 'Balance',
|
||||
gasLimit: 'Gas',
|
||||
@@ -243,28 +258,52 @@ export default {
|
||||
data: 'Bytes',
|
||||
salt: 'Bytes'
|
||||
},
|
||||
InstantiateRequest: {
|
||||
_fallback: 'InstantiateRequestV2',
|
||||
origin: 'AccountId',
|
||||
value: 'Balance',
|
||||
gasLimit: 'Gas',
|
||||
storageDepositLimit: 'Option<Balance>',
|
||||
code: 'CodeSource',
|
||||
data: 'Bytes',
|
||||
salt: 'Bytes'
|
||||
},
|
||||
ContractInstantiateResultTo267: {
|
||||
_enum: {
|
||||
Ok: 'InstantiateReturnValueTo267',
|
||||
Err: 'Null'
|
||||
}
|
||||
},
|
||||
ContractInstantiateResult: {
|
||||
ContractInstantiateResultTo299: {
|
||||
_enum: {
|
||||
Ok: 'InstantiateReturnValue',
|
||||
Err: 'Null'
|
||||
}
|
||||
},
|
||||
_fallback: 'ContractInstantiateResultTo267'
|
||||
},
|
||||
ContractInstantiateResult: {
|
||||
_fallback: 'ContractInstantiateResultTo299',
|
||||
gasConsumed: 'u64',
|
||||
gasRequired: 'u64',
|
||||
storageDeposit: 'StorageDeposit',
|
||||
debugMessage: 'Text',
|
||||
result: 'InstantiateReturnValue'
|
||||
},
|
||||
InstantiateReturnValueTo267: {
|
||||
result: 'ExecReturnValue',
|
||||
accountId: 'AccountId',
|
||||
rentProjection: 'Option<RentProjection>'
|
||||
},
|
||||
InstantiateReturnValue: {
|
||||
_fallback: 'InstantiateReturnValueTo267',
|
||||
InstantiateReturnValueOk: {
|
||||
result: 'ExecReturnValue',
|
||||
accountId: 'AccountId'
|
||||
},
|
||||
InstantiateReturnValue: {
|
||||
_enum: {
|
||||
Ok: 'InstantiateReturnValueOk',
|
||||
Err: 'DispatchError'
|
||||
}
|
||||
},
|
||||
InstructionWeights: {
|
||||
i64const: 'u32',
|
||||
i64load: 'u32',
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
import type { Bytes, Compact, Enum, Null, Option, Raw, Set, Struct, Text, U8aFixed, bool, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { AccountId, Balance, BlockNumber, Hash, Weight } from '@polkadot/types/interfaces/runtime';
|
||||
import type { DispatchError } from '@polkadot/types/interfaces/system';
|
||||
|
||||
/** @name AliveContractInfo */
|
||||
export interface AliveContractInfo extends Struct {
|
||||
@@ -20,6 +21,15 @@ export interface AliveContractInfo extends Struct {
|
||||
/** @name CodeHash */
|
||||
export interface CodeHash extends Hash {}
|
||||
|
||||
/** @name CodeSource */
|
||||
export interface CodeSource extends Enum {
|
||||
readonly isUpload: boolean;
|
||||
readonly asUpload: Bytes;
|
||||
readonly isExisting: boolean;
|
||||
readonly asExisting: Hash;
|
||||
readonly type: 'Upload' | 'Existing';
|
||||
}
|
||||
|
||||
/** @name CodeUploadRequest */
|
||||
export interface CodeUploadRequest extends Struct {
|
||||
readonly origin: AccountId;
|
||||
@@ -147,11 +157,12 @@ export interface ContractInfo extends Enum {
|
||||
}
|
||||
|
||||
/** @name ContractInstantiateResult */
|
||||
export interface ContractInstantiateResult extends Enum {
|
||||
readonly isOk: boolean;
|
||||
readonly asOk: InstantiateReturnValue;
|
||||
readonly isErr: boolean;
|
||||
readonly type: 'Ok' | 'Err';
|
||||
export interface ContractInstantiateResult extends Struct {
|
||||
readonly gasConsumed: u64;
|
||||
readonly gasRequired: u64;
|
||||
readonly storageDeposit: StorageDeposit;
|
||||
readonly debugMessage: Text;
|
||||
readonly result: InstantiateReturnValue;
|
||||
}
|
||||
|
||||
/** @name ContractInstantiateResultTo267 */
|
||||
@@ -162,6 +173,14 @@ export interface ContractInstantiateResultTo267 extends Enum {
|
||||
readonly type: 'Ok' | 'Err';
|
||||
}
|
||||
|
||||
/** @name ContractInstantiateResultTo299 */
|
||||
export interface ContractInstantiateResultTo299 extends Enum {
|
||||
readonly isOk: boolean;
|
||||
readonly asOk: InstantiateReturnValue;
|
||||
readonly isErr: boolean;
|
||||
readonly type: 'Ok' | 'Err';
|
||||
}
|
||||
|
||||
/** @name ContractReturnFlags */
|
||||
export interface ContractReturnFlags extends Set {
|
||||
readonly isRevert: boolean;
|
||||
@@ -292,6 +311,27 @@ export interface HostFnWeightsTo264 extends Struct {
|
||||
|
||||
/** @name InstantiateRequest */
|
||||
export interface InstantiateRequest extends Struct {
|
||||
readonly origin: AccountId;
|
||||
readonly value: Balance;
|
||||
readonly gasLimit: Gas;
|
||||
readonly storageDepositLimit: Option<Balance>;
|
||||
readonly code: CodeSource;
|
||||
readonly data: Bytes;
|
||||
readonly salt: Bytes;
|
||||
}
|
||||
|
||||
/** @name InstantiateRequestV1 */
|
||||
export interface InstantiateRequestV1 extends Struct {
|
||||
readonly origin: AccountId;
|
||||
readonly value: Balance;
|
||||
readonly gasLimit: Gas;
|
||||
readonly code: Bytes;
|
||||
readonly data: Bytes;
|
||||
readonly salt: Bytes;
|
||||
}
|
||||
|
||||
/** @name InstantiateRequestV2 */
|
||||
export interface InstantiateRequestV2 extends Struct {
|
||||
readonly origin: AccountId;
|
||||
readonly value: Balance;
|
||||
readonly gasLimit: Gas;
|
||||
@@ -302,7 +342,16 @@ export interface InstantiateRequest extends Struct {
|
||||
}
|
||||
|
||||
/** @name InstantiateReturnValue */
|
||||
export interface InstantiateReturnValue extends Struct {
|
||||
export interface InstantiateReturnValue extends Enum {
|
||||
readonly isOk: boolean;
|
||||
readonly asOk: InstantiateReturnValueOk;
|
||||
readonly isErr: boolean;
|
||||
readonly asErr: DispatchError;
|
||||
readonly type: 'Ok' | 'Err';
|
||||
}
|
||||
|
||||
/** @name InstantiateReturnValueOk */
|
||||
export interface InstantiateReturnValueOk extends Struct {
|
||||
readonly result: ExecReturnValue;
|
||||
readonly accountId: AccountId;
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
export type DefinitionTypeType = string;
|
||||
|
||||
export type DefinitionTypeEnum = { _enum: DefinitionTypeType[] } | { _enum: Record<string, DefinitionTypeType | null> };
|
||||
export type DefinitionTypeEnum = { _fallback?: DefinitionTypeType } & ({ _enum: DefinitionTypeType[] } | { _enum: Record<string, DefinitionTypeType | null> });
|
||||
|
||||
export type DefinitionTypeSet = { _set: Record<string, number> };
|
||||
export type DefinitionTypeSet = { _fallback?: DefinitionTypeType, _set: Record<string, number> };
|
||||
|
||||
type DefinitionTypeStructExtra = {
|
||||
_alias?: Record<string, DefinitionTypeType>;
|
||||
|
||||
Reference in New Issue
Block a user