From fa0add8564ce75157a8f122a09edc720444705cc Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 10 Mar 2021 22:00:57 +0100 Subject: [PATCH] Adjust to new auction types (#3297) * Adjust to new auction types * Update BitVec fields, Babe types --- .../api-contract/src/checkTypes.manual.ts | 4 +- packages/types/src/augment/registry.ts | 43 +++++-------- .../types/src/interfaces/babe/definitions.ts | 4 ++ packages/types/src/interfaces/babe/types.ts | 6 ++ .../src/interfaces/crowdloan/definitions.ts | 21 +++---- .../types/src/interfaces/crowdloan/types.ts | 29 ++++----- .../types/src/interfaces/parachains/slots.ts | 60 +++++++++---------- .../types/src/interfaces/parachains/types.ts | 47 +-------------- .../src/interfaces/runtime/definitions.ts | 7 +++ .../types/src/interfaces/runtime/types.ts | 10 ++++ packages/types/src/primitive/BitVec.ts | 4 ++ 11 files changed, 102 insertions(+), 133 deletions(-) diff --git a/packages/api-contract/src/checkTypes.manual.ts b/packages/api-contract/src/checkTypes.manual.ts index ff9c7abbee..b76a3623d5 100644 --- a/packages/api-contract/src/checkTypes.manual.ts +++ b/packages/api-contract/src/checkTypes.manual.ts @@ -37,7 +37,9 @@ async function checkContract (api: ApiPromise, pairs: TestKeyringMap): Promise { - const api = await ApiPromise.create(); + const api = await ApiPromise.create({ + hasher: (data: Uint8Array): Uint8Array => data + }); const pairs = createTestPairs(); // eslint-disable-next-line @typescript-eslint/no-floating-promises diff --git a/packages/types/src/augment/registry.ts b/packages/types/src/augment/registry.ts index 8abbe641a0..68546b7c1a 100644 --- a/packages/types/src/augment/registry.ts +++ b/packages/types/src/augment/registry.ts @@ -7,7 +7,7 @@ import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polka import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura'; import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; -import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe'; +import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe'; import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances'; import type { BlockHash } from '@polkadot/types/interfaces/chain'; import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; @@ -16,7 +16,7 @@ import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } 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, DeletedContract, Gas, HostFnWeights, HostFnWeightsTo264, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, 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 { DeployData, FundIndex, FundInfo, LastContribution } from '@polkadot/types/interfaces/crowdloan'; +import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan'; 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'; import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine'; @@ -32,14 +32,14 @@ import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lotter import type { DoubleMapTypeLatest, DoubleMapTypeV10, DoubleMapTypeV11, DoubleMapTypeV12, DoubleMapTypeV9, ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV9, MapTypeLatest, MapTypeV10, MapTypeV11, MapTypeV12, MapTypeV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV9, ModuleConstantMetadataLatest, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV9, ModuleMetadataLatest, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV9, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV9, StorageMetadataLatest, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; import type { StorageKind } from '@polkadot/types/interfaces/offchain'; import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences'; -import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AbstractFungible, AbstractNonFungible, AccountId32Junction, AccountIndex64Junction, AccountKey20Junction, AssetInstance, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Balances, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, ConcreteFungible, ConcreteNonFungible, CoreAssignment, CoreIndex, CoreOccupied, DepositAsset, DepositReserveAsset, DoubleVoteReport, DownwardMessage, ExchangeAsset, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InitiateReserveWithdraw, InitiateTeleport, Junction, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiAsset, MultiLocation, NetworkId, NewBidder, NewBidderOption, Order, OriginKind, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueryHolding, QueuedParathread, RegisteredParachainInfo, RelayChainBlockNumber, RelayChainHash, RelayTo, RelayedFrom, Remark, ReserveAssetDeposit, Retriable, Scheduling, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, Statement, SubId, SystemInherentData, TeleportAsset, Transact, TransientValidationData, UpwardMessage, ValidationCode, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, WinnersData, WinnersDataTuple, WinningData, WinningDataEntry, WithdrawAsset, Xcm, XcmError, XcmResult } from '@polkadot/types/interfaces/parachains'; +import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AbstractFungible, AbstractNonFungible, AccountId32Junction, AccountIndex64Junction, AccountKey20Junction, AssetInstance, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Balances, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, ConcreteFungible, ConcreteNonFungible, CoreAssignment, CoreIndex, CoreOccupied, DepositAsset, DepositReserveAsset, DoubleVoteReport, DownwardMessage, ExchangeAsset, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, InitiateReserveWithdraw, InitiateTeleport, Junction, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiAsset, MultiLocation, NetworkId, Order, OriginKind, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueryHolding, QueuedParathread, RegisteredParachainInfo, RelayChainBlockNumber, RelayChainHash, RelayTo, RelayedFrom, Remark, ReserveAssetDeposit, Retriable, Scheduling, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, Statement, SystemInherentData, TeleportAsset, Transact, TransientValidationData, UpwardMessage, ValidationCode, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, WinnersData, WinnersDataTuple, WinningData, WinningDataEntry, WithdrawAsset, Xcm, XcmError, XcmResult } from '@polkadot/types/interfaces/parachains'; import type { FeeDetails, InclusionFee, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; import type { Approvals } from '@polkadot/types/interfaces/poll'; import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy'; import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase'; import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; import type { RpcMethods } from '@polkadot/types/interfaces/rpc'; -import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H512, H64, Hash, Header, I32F32, Index, IndicesLookupSource, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, OpaqueCall, Origin, OriginCaller, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, Slot, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H512, H64, Hash, Header, I32F32, Index, IndicesLookupSource, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, Slot, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo'; import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler'; import type { FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys7, SessionKeys8, SessionKeys9, ValidatorCount } from '@polkadot/types/interfaces/session'; @@ -116,10 +116,10 @@ declare module '@polkadot/types/types/registry' { 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; - 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; + 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; @@ -196,6 +196,7 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -206,7 +207,6 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; - 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -297,7 +297,6 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; - 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -480,9 +479,6 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; - 'Option': Option; - 'Option': Option; - 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -553,12 +549,11 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; - 'Option': Option; - 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -795,7 +790,6 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; - 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -813,6 +807,7 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -942,6 +937,7 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -952,7 +948,6 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; - 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1043,7 +1038,6 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; - 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1226,9 +1220,6 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; - 'Vec': Vec; - 'Vec': Vec; - 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1299,12 +1290,11 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; - 'Vec': Vec; - 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1541,7 +1531,6 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; - 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1559,6 +1548,7 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1688,6 +1678,7 @@ declare module '@polkadot/types/types/registry' { AvailabilityBitfieldRecord: AvailabilityBitfieldRecord; BabeAuthorityWeight: BabeAuthorityWeight; BabeBlockWeight: BabeBlockWeight; + BabeEpochConfiguration: BabeEpochConfiguration; BabeEquivocationProof: BabeEquivocationProof; BabeWeight: BabeWeight; BackedCandidate: BackedCandidate; @@ -1698,7 +1689,6 @@ declare module '@polkadot/types/types/registry' { Balances: Balances; BalanceStatus: BalanceStatus; Bid: Bid; - Bidder: Bidder; BidKind: BidKind; BitVec: BitVec; Block: Block; @@ -1789,7 +1779,6 @@ declare module '@polkadot/types/types/registry' { DefunctVoter: DefunctVoter; Delegations: Delegations; DeletedContract: DeletedContract; - DeployData: DeployData; DepositAsset: DepositAsset; DepositReserveAsset: DepositReserveAsset; Digest: Digest; @@ -1972,9 +1961,6 @@ declare module '@polkadot/types/types/registry' { InboundHrmpMessages: InboundHrmpMessages; IncludedBlocks: IncludedBlocks; InclusionFee: InclusionFee; - IncomingParachain: IncomingParachain; - IncomingParachainDeploy: IncomingParachainDeploy; - IncomingParachainFixed: IncomingParachainFixed; Index: Index; IndicesLookupSource: IndicesLookupSource; IndividualExposure: IndividualExposure; @@ -2045,12 +2031,11 @@ declare module '@polkadot/types/types/registry' { Multiplier: Multiplier; Multisig: Multisig; MultiSignature: MultiSignature; + MultiSigner: MultiSigner; NetworkId: NetworkId; NetworkState: NetworkState; NetworkStatePeerset: NetworkStatePeerset; NetworkStatePeersetInfo: NetworkStatePeersetInfo; - NewBidder: NewBidder; - NewBidderOption: NewBidderOption; NextAuthority: NextAuthority; NextConfigDescriptor: NextConfigDescriptor; NextConfigDescriptorV1: NextConfigDescriptorV1; @@ -2287,7 +2272,6 @@ declare module '@polkadot/types/types/registry' { StoredPendingChange: StoredPendingChange; StoredState: StoredState; StrikeCount: StrikeCount; - SubId: SubId; SyncState: SyncState; SystemInherentData: SystemInherentData; SystemOrigin: SystemOrigin; @@ -2305,6 +2289,7 @@ declare module '@polkadot/types/types/registry' { TransientValidationData: TransientValidationData; TreasuryProposal: TreasuryProposal; TrieId: TrieId; + TrieIndex: TrieIndex; Type: Type; u128: u128; U128: U128; diff --git a/packages/types/src/interfaces/babe/definitions.ts b/packages/types/src/interfaces/babe/definitions.ts index 145c3a4da7..ce1932a935 100644 --- a/packages/types/src/interfaces/babe/definitions.ts +++ b/packages/types/src/interfaces/babe/definitions.ts @@ -19,6 +19,10 @@ export default { _enum: ['PrimarySlots', 'PrimaryAndSecondaryPlainSlots', 'PrimaryAndSecondaryVRFSlots'] }, BabeAuthorityWeight: 'u64', + BabeEpochConfiguration: { + c: '(u64, u64)', + allowedSlots: 'AllowedSlots' + }, BabeBlockWeight: 'u32', BabeEquivocationProof: { offender: 'AuthorityId', diff --git a/packages/types/src/interfaces/babe/types.ts b/packages/types/src/interfaces/babe/types.ts index b4176c36fb..e6c9bed96a 100644 --- a/packages/types/src/interfaces/babe/types.ts +++ b/packages/types/src/interfaces/babe/types.ts @@ -19,6 +19,12 @@ export interface BabeAuthorityWeight extends u64 {} /** @name BabeBlockWeight */ export interface BabeBlockWeight extends u32 {} +/** @name BabeEpochConfiguration */ +export interface BabeEpochConfiguration extends Struct { + readonly c: ITuple<[u64, u64]>; + readonly allowedSlots: AllowedSlots; +} + /** @name BabeEquivocationProof */ export interface BabeEquivocationProof extends Struct { readonly offender: AuthorityId; diff --git a/packages/types/src/interfaces/crowdloan/definitions.ts b/packages/types/src/interfaces/crowdloan/definitions.ts index 8513d276cc..5529964fda 100644 --- a/packages/types/src/interfaces/crowdloan/definitions.ts +++ b/packages/types/src/interfaces/crowdloan/definitions.ts @@ -13,26 +13,23 @@ export default { LastContribution: { _enum: { Never: 'Null', - PreEnding: 'AuctionIndex', + PreEnding: 'u32', Ending: 'BlockNumber' } }, - DeployData: { - codeHash: 'Hash', - codeSize: 'u32', - initialHeadData: 'HeadData' - }, FundInfo: { - parachain: 'Option', - owner: 'AccountId', + retiring: 'bool', + depositor: 'AccountId', + verifier: 'Option', deposit: 'Balance', raised: 'Balance', end: 'BlockNumber', cap: 'Balance', lastContribution: 'LastContribution', - firstSlot: 'BlockNumber', - lastSlot: 'BlockNumber', - deployData: 'Option' - } + firstSlot: 'LeasePeriod', + lastSlot: 'LeasePeriod', + trieIndex: 'TrieIndex' + }, + TrieIndex: 'u32' } } as Definitions; diff --git a/packages/types/src/interfaces/crowdloan/types.ts b/packages/types/src/interfaces/crowdloan/types.ts index ddce183b2c..212223533b 100644 --- a/packages/types/src/interfaces/crowdloan/types.ts +++ b/packages/types/src/interfaces/crowdloan/types.ts @@ -1,41 +1,38 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { Enum, Option, Struct, u32 } from '@polkadot/types'; -import type { AuctionIndex, HeadData, ParaId } from '@polkadot/types/interfaces/parachains'; -import type { AccountId, Balance, BlockNumber, Hash } from '@polkadot/types/interfaces/runtime'; - -/** @name DeployData */ -export interface DeployData extends Struct { - readonly codeHash: Hash; - readonly codeSize: u32; - readonly initialHeadData: HeadData; -} +import type { Enum, Option, Struct, bool, u32 } from '@polkadot/types'; +import type { LeasePeriod } from '@polkadot/types/interfaces/parachains'; +import type { AccountId, Balance, BlockNumber, MultiSigner } from '@polkadot/types/interfaces/runtime'; /** @name FundIndex */ export interface FundIndex extends u32 {} /** @name FundInfo */ export interface FundInfo extends Struct { - readonly parachain: Option; - readonly owner: AccountId; + readonly retiring: bool; + readonly depositor: AccountId; + readonly verifier: Option; readonly deposit: Balance; readonly raised: Balance; readonly end: BlockNumber; readonly cap: Balance; readonly lastContribution: LastContribution; - readonly firstSlot: BlockNumber; - readonly lastSlot: BlockNumber; - readonly deployData: Option; + readonly firstSlot: LeasePeriod; + readonly lastSlot: LeasePeriod; + readonly trieIndex: TrieIndex; } /** @name LastContribution */ export interface LastContribution extends Enum { readonly isNever: boolean; readonly isPreEnding: boolean; - readonly asPreEnding: AuctionIndex; + readonly asPreEnding: u32; readonly isEnding: boolean; readonly asEnding: BlockNumber; } +/** @name TrieIndex */ +export interface TrieIndex extends u32 {} + export type PHANTOM_CROWDLOAN = 'crowdloan'; diff --git a/packages/types/src/interfaces/parachains/slots.ts b/packages/types/src/interfaces/parachains/slots.ts index 430912f3ac..32740189e9 100644 --- a/packages/types/src/interfaces/parachains/slots.ts +++ b/packages/types/src/interfaces/parachains/slots.ts @@ -8,41 +8,41 @@ const SLOT_RANGE_COUNT = 10; export default { AuctionIndex: 'u32', - Bidder: { - _enum: { - New: 'NewBidder', - Existing: 'ParaId' - } - }, - IncomingParachain: { - _enum: { - Unset: 'NewBidder', - Fixed: 'IncomingParachainFixed', - Deploy: 'IncomingParachainDeploy' - } - }, - IncomingParachainDeploy: { - code: 'ValidationCode', - initialHeadData: 'HeadData' - }, - IncomingParachainFixed: { - codeHash: 'Hash', - codeSize: 'u32', - initialHeadData: 'HeadData' - }, + // Bidder: { + // _enum: { + // New: 'NewBidder', + // Existing: 'ParaId' + // } + // }, + // IncomingParachain: { + // _enum: { + // Unset: 'NewBidder', + // Fixed: 'IncomingParachainFixed', + // Deploy: 'IncomingParachainDeploy' + // } + // }, + // IncomingParachainDeploy: { + // code: 'ValidationCode', + // initialHeadData: 'HeadData' + // }, + // IncomingParachainFixed: { + // codeHash: 'Hash', + // codeSize: 'u32', + // initialHeadData: 'HeadData' + // }, LeasePeriod: 'BlockNumber', LeasePeriodOf: 'BlockNumber', - NewBidder: { - who: 'AccountId', - sub: 'SubId' - }, - NewBidderOption: 'Option', + // NewBidder: { + // who: 'AccountId', + // sub: 'SubId' + // }, + // NewBidderOption: 'Option', SlotRange: { _enum: ['ZeroZero', 'ZeroOne', 'ZeroTwo', 'ZeroThree', 'OneOne', 'OneTwo', 'OneThree', 'TwoTwo', 'TwoThree', 'ThreeThree'] }, - SubId: 'u32', + // SubId: 'u32', WinningData: `[WinningDataEntry; ${SLOT_RANGE_COUNT}]`, - WinningDataEntry: 'Option', + WinningDataEntry: 'Option<(AccountId, ParaId, BalanceOf)>', WinnersData: 'Vec', - WinnersDataTuple: '(NewBidderOption, ParaId, BalanceOf, SlotRange)' + WinnersDataTuple: '(AccountId, ParaId, BalanceOf, SlotRange)' }; diff --git a/packages/types/src/interfaces/parachains/types.ts b/packages/types/src/interfaces/parachains/types.ts index a36661a6b8..2cc74a5c4f 100644 --- a/packages/types/src/interfaces/parachains/types.ts +++ b/packages/types/src/interfaces/parachains/types.ts @@ -141,14 +141,6 @@ export interface Balances extends Struct { readonly assets: Vec; } -/** @name Bidder */ -export interface Bidder extends Enum { - readonly isNew: boolean; - readonly asNew: NewBidder; - readonly isExisting: boolean; - readonly asExisting: ParaId; -} - /** @name BufferedSessionChange */ export interface BufferedSessionChange extends Struct { readonly applyAt: BlockNumber; @@ -368,29 +360,6 @@ export interface InboundHrmpMessage extends Struct { /** @name InboundHrmpMessages */ export interface InboundHrmpMessages extends Vec {} -/** @name IncomingParachain */ -export interface IncomingParachain extends Enum { - readonly isUnset: boolean; - readonly asUnset: NewBidder; - readonly isFixed: boolean; - readonly asFixed: IncomingParachainFixed; - readonly isDeploy: boolean; - readonly asDeploy: IncomingParachainDeploy; -} - -/** @name IncomingParachainDeploy */ -export interface IncomingParachainDeploy extends Struct { - readonly code: ValidationCode; - readonly initialHeadData: HeadData; -} - -/** @name IncomingParachainFixed */ -export interface IncomingParachainFixed extends Struct { - readonly codeHash: Hash; - readonly codeSize: u32; - readonly initialHeadData: HeadData; -} - /** @name InitiateReserveWithdraw */ export interface InitiateReserveWithdraw extends Struct { readonly assets: Vec; @@ -502,15 +471,6 @@ export interface NetworkId extends Enum { readonly isKusama: boolean; } -/** @name NewBidder */ -export interface NewBidder extends Struct { - readonly who: AccountId; - readonly sub: SubId; -} - -/** @name NewBidderOption */ -export interface NewBidderOption extends Option {} - /** @name Order */ export interface Order extends Enum { readonly isNull: boolean; @@ -746,9 +706,6 @@ export interface Statement extends Enum { readonly asInvalid: Hash; } -/** @name SubId */ -export interface SubId extends u32 {} - /** @name SystemInherentData */ export interface SystemInherentData extends ParachainInherentData {} @@ -835,13 +792,13 @@ export interface VersionedXcm extends Enum { export interface WinnersData extends Vec {} /** @name WinnersDataTuple */ -export interface WinnersDataTuple extends ITuple<[NewBidderOption, ParaId, BalanceOf, SlotRange]> {} +export interface WinnersDataTuple extends ITuple<[AccountId, ParaId, BalanceOf, SlotRange]> {} /** @name WinningData */ export interface WinningData extends Vec {} /** @name WinningDataEntry */ -export interface WinningDataEntry extends Option {} +export interface WinningDataEntry extends Option> {} /** @name WithdrawAsset */ export interface WithdrawAsset extends Struct { diff --git a/packages/types/src/interfaces/runtime/definitions.ts b/packages/types/src/interfaces/runtime/definitions.ts index 197e9b8068..58d7ee29d1 100644 --- a/packages/types/src/interfaces/runtime/definitions.ts +++ b/packages/types/src/interfaces/runtime/definitions.ts @@ -87,6 +87,13 @@ export default { LookupTarget: 'AccountId', ModuleId: 'LockIdentifier', MultiAddress: 'GenericMultiAddress', + MultiSigner: { + _enum: { + Ed25519: '[u8; 32]', + Sr25519: '[u8; 32]', + Ecdsa: '[u8; 33]' + } + }, Moment: 'UInt<64, Moment>', OpaqueCall: 'Bytes', Origin: 'DoNotConstruct', diff --git a/packages/types/src/interfaces/runtime/types.ts b/packages/types/src/interfaces/runtime/types.ts index a465a2c41b..9033cff5d9 100644 --- a/packages/types/src/interfaces/runtime/types.ts +++ b/packages/types/src/interfaces/runtime/types.ts @@ -174,6 +174,16 @@ export interface Moment extends UInt {} /** @name MultiAddress */ export interface MultiAddress extends GenericMultiAddress {} +/** @name MultiSigner */ +export interface MultiSigner extends Enum { + readonly isEd25519: boolean; + readonly asEd25519: U8aFixed; + readonly isSr25519: boolean; + readonly asSr25519: U8aFixed; + readonly isEcdsa: boolean; + readonly asEcdsa: U8aFixed; +} + /** @name OpaqueCall */ export interface OpaqueCall extends Bytes {} diff --git a/packages/types/src/primitive/BitVec.ts b/packages/types/src/primitive/BitVec.ts index 764c46b5b6..eaabee48ef 100644 --- a/packages/types/src/primitive/BitVec.ts +++ b/packages/types/src/primitive/BitVec.ts @@ -49,6 +49,10 @@ export class BitVec extends Raw { return this.length + compactToU8a(this.bitLength()).length; } + public toHuman (): string { + return `0b${[...this.toU8a(true)].map((d) => `00000000${d.toString(2)}`.slice(-8)).join('_')}`; + } + /** * @description Returns the base runtime type name for this instance */