Skip to content

Commit ee42e3a

Browse files
authored
Reset/Revert v1 of runtime query_info (w/ detect) (#5342)
* Reset/Revert v1 of runtime quety_info (w/ detect) * Add V2 struct
1 parent 12fd31d commit ee42e3a

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

packages/types-augment/src/registry/interfaces.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import type { NpApiError } from '@polkadot/types/interfaces/nompools';
4646
import type { StorageKind } from '@polkadot/types/interfaces/offchain';
4747
import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences';
4848
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, CoreState, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, GroupRotationInfo, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OccupiedCore, OccupiedCoreAssumption, OldV1SessionInfo, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, PvfCheckStatement, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, ScheduledCore, Scheduling, ScrapedOnChainVotes, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
49-
import type { FeeDetails, InclusionFee, RuntimeDispatchInfo, RuntimeDispatchInfoV1 } from '@polkadot/types/interfaces/payment';
49+
import type { FeeDetails, InclusionFee, RuntimeDispatchInfo, RuntimeDispatchInfoV1, RuntimeDispatchInfoV2 } from '@polkadot/types/interfaces/payment';
5050
import type { Approvals } from '@polkadot/types/interfaces/poll';
5151
import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy';
5252
import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase';
@@ -878,6 +878,7 @@ declare module '@polkadot/types/types/registry' {
878878
RuntimeDbWeight: RuntimeDbWeight;
879879
RuntimeDispatchInfo: RuntimeDispatchInfo;
880880
RuntimeDispatchInfoV1: RuntimeDispatchInfoV1;
881+
RuntimeDispatchInfoV2: RuntimeDispatchInfoV2;
881882
RuntimeVersion: RuntimeVersion;
882883
RuntimeVersionApi: RuntimeVersionApi;
883884
RuntimeVersionPartial: RuntimeVersionPartial;

packages/types/src/interfaces/payment/definitions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ export default {
3232
weight: 'WeightV1',
3333
class: 'DispatchClass',
3434
partialFee: 'Balance'
35+
},
36+
RuntimeDispatchInfoV2: {
37+
weight: 'WeightV2',
38+
class: 'DispatchClass',
39+
partialFee: 'Balance'
3540
}
3641
}
3742
} as Definitions;

packages/types/src/interfaces/payment/runtime.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ export const runtime: DefinitionsCall = {
7474
type: 'u32'
7575
}
7676
],
77-
type: 'RuntimeDispatchInfoV1'
77+
// NOTE: _Should_ be V1 (as per current Substrate), however the interface was changed mid-flight between
78+
// versions. So we have some of each depending on runtime. (We do detect the weight type, so correct)
79+
// type: 'RuntimeDispatchInfoV1'
80+
type: 'RuntimeDispatchInfo'
7881
}
7982
}, V1_V2_SHARED_PAY),
8083
version: 1
@@ -114,7 +117,10 @@ export const runtime: DefinitionsCall = {
114117
type: 'u32'
115118
}
116119
],
117-
type: 'RuntimeDispatchInfoV1'
120+
// NOTE: _Should_ be V1 (as per current Substrate), however the interface was changed mid-flight between
121+
// versions. So we have some of each depending on runtime. (We do detect the weight type, so correct)
122+
// type: 'RuntimeDispatchInfoV1'
123+
type: 'RuntimeDispatchInfo'
118124
}
119125
}, V1_V2_SHARED_CALL),
120126
version: 1

packages/types/src/interfaces/payment/types.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* eslint-disable */
33

44
import type { Option, Struct } from '@polkadot/types-codec';
5-
import type { Balance, Weight, WeightV1 } from '@polkadot/types/interfaces/runtime';
5+
import type { Balance, Weight, WeightV1, WeightV2 } from '@polkadot/types/interfaces/runtime';
66
import type { DispatchClass } from '@polkadot/types/interfaces/system';
77

88
/** @name FeeDetails */
@@ -31,4 +31,11 @@ export interface RuntimeDispatchInfoV1 extends Struct {
3131
readonly partialFee: Balance;
3232
}
3333

34+
/** @name RuntimeDispatchInfoV2 */
35+
export interface RuntimeDispatchInfoV2 extends Struct {
36+
readonly weight: WeightV2;
37+
readonly class: DispatchClass;
38+
readonly partialFee: Balance;
39+
}
40+
3441
export type PHANTOM_PAYMENT = 'payment';

0 commit comments

Comments
 (0)