Update contract types (#3032)
* Update contract types * Add registry lookup name compat * cleanup * Rebuild ts defs
This commit is contained in:
@@ -14,7 +14,7 @@ import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
|
||||
import type { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims';
|
||||
import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
|
||||
import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
|
||||
import type { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractStorageKey, Gas, HostFnWeights, InstructionWeights, Limits, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
|
||||
import type { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractStorageKey, DeletedContract, Gas, HostFnWeights, InstructionWeights, Limits, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
|
||||
import type { ContractConstructorSpec, ContractContractSpec, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpec, ContractEventSpec, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpec, ContractMessageSpec, ContractProject, ContractProjectContract, ContractProjectSource, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
|
||||
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
|
||||
import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
|
||||
@@ -588,6 +588,9 @@ declare module '@polkadot/types/types/registry' {
|
||||
ContractStorageKey: ContractStorageKey;
|
||||
'Option<ContractStorageKey>': Option<ContractStorageKey>;
|
||||
'Vec<ContractStorageKey>': Vec<ContractStorageKey>;
|
||||
DeletedContract: DeletedContract;
|
||||
'Option<DeletedContract>': Option<DeletedContract>;
|
||||
'Vec<DeletedContract>': Vec<DeletedContract>;
|
||||
Gas: Gas;
|
||||
'Compact<Gas>': Compact<Gas>;
|
||||
'Option<Gas>': Option<Gas>;
|
||||
|
||||
@@ -38,8 +38,9 @@ function injectErrors (_: Registry, metadata: Metadata, metadataErrors: Record<s
|
||||
const eventIndex = new Uint8Array([sectionIndex, index]);
|
||||
|
||||
metadataErrors[u8aToHex(eventIndex)] = {
|
||||
documentation: documentation.map((d): string => d.toString()),
|
||||
documentation: documentation.map((d) => d.toString()),
|
||||
index,
|
||||
method: name.toString(),
|
||||
name: name.toString(),
|
||||
section: sectionName
|
||||
};
|
||||
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
zombies: 'u32',
|
||||
accounts: 'u32'
|
||||
},
|
||||
TAssetBalance: 'Balance',
|
||||
TAssetBalance: 'u64',
|
||||
TAssetDepositBalance: 'BalanceOf'
|
||||
}
|
||||
} as Definitions;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Struct, bool, u32 } from '@polkadot/types';
|
||||
import type { AccountId, Balance, BalanceOf } from '@polkadot/types/interfaces/runtime';
|
||||
import type { Struct, bool, u32, u64 } from '@polkadot/types';
|
||||
import type { AccountId, BalanceOf } from '@polkadot/types/interfaces/runtime';
|
||||
|
||||
/** @name AssetBalance */
|
||||
export interface AssetBalance extends Struct {
|
||||
@@ -26,7 +26,7 @@ export interface AssetDetails extends Struct {
|
||||
}
|
||||
|
||||
/** @name TAssetBalance */
|
||||
export interface TAssetBalance extends Balance {}
|
||||
export interface TAssetBalance extends u64 {}
|
||||
|
||||
/** @name TAssetDepositBalance */
|
||||
export interface TAssetDepositBalance extends BalanceOf {}
|
||||
|
||||
@@ -136,6 +136,10 @@ export default {
|
||||
}
|
||||
},
|
||||
ContractStorageKey: '[u8; 32]',
|
||||
DeletedContract: {
|
||||
pairCount: 'u32',
|
||||
trieId: 'TrieId'
|
||||
},
|
||||
Gas: 'u64',
|
||||
HostFnWeights: {
|
||||
caller: 'Weight',
|
||||
|
||||
@@ -104,6 +104,12 @@ export interface ContractInfo extends Enum {
|
||||
/** @name ContractStorageKey */
|
||||
export interface ContractStorageKey extends U8aFixed {}
|
||||
|
||||
/** @name DeletedContract */
|
||||
export interface DeletedContract extends Struct {
|
||||
readonly pairCount: u32;
|
||||
readonly trieId: TrieId;
|
||||
}
|
||||
|
||||
/** @name Gas */
|
||||
export interface Gas extends u64 {}
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ export type RegistryTypes = Record<string, Constructor | string | Record<string,
|
||||
export interface RegistryError {
|
||||
documentation: string[];
|
||||
index: number;
|
||||
// compat
|
||||
method: string;
|
||||
name: string;
|
||||
section: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user