Reset/Revert v1 of runtime query_info (w/ detect) (#5342)
* Reset/Revert v1 of runtime quety_info (w/ detect) * Add V2 struct
This commit is contained in:
@@ -32,6 +32,11 @@ export default {
|
||||
weight: 'WeightV1',
|
||||
class: 'DispatchClass',
|
||||
partialFee: 'Balance'
|
||||
},
|
||||
RuntimeDispatchInfoV2: {
|
||||
weight: 'WeightV2',
|
||||
class: 'DispatchClass',
|
||||
partialFee: 'Balance'
|
||||
}
|
||||
}
|
||||
} as Definitions;
|
||||
|
||||
@@ -74,7 +74,10 @@ export const runtime: DefinitionsCall = {
|
||||
type: 'u32'
|
||||
}
|
||||
],
|
||||
type: 'RuntimeDispatchInfoV1'
|
||||
// NOTE: _Should_ be V1 (as per current Substrate), however the interface was changed mid-flight between
|
||||
// versions. So we have some of each depending on runtime. (We do detect the weight type, so correct)
|
||||
// type: 'RuntimeDispatchInfoV1'
|
||||
type: 'RuntimeDispatchInfo'
|
||||
}
|
||||
}, V1_V2_SHARED_PAY),
|
||||
version: 1
|
||||
@@ -114,7 +117,10 @@ export const runtime: DefinitionsCall = {
|
||||
type: 'u32'
|
||||
}
|
||||
],
|
||||
type: 'RuntimeDispatchInfoV1'
|
||||
// NOTE: _Should_ be V1 (as per current Substrate), however the interface was changed mid-flight between
|
||||
// versions. So we have some of each depending on runtime. (We do detect the weight type, so correct)
|
||||
// type: 'RuntimeDispatchInfoV1'
|
||||
type: 'RuntimeDispatchInfo'
|
||||
}
|
||||
}, V1_V2_SHARED_CALL),
|
||||
version: 1
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Option, Struct } from '@polkadot/types-codec';
|
||||
import type { Balance, Weight, WeightV1 } from '@polkadot/types/interfaces/runtime';
|
||||
import type { Balance, Weight, WeightV1, WeightV2 } from '@polkadot/types/interfaces/runtime';
|
||||
import type { DispatchClass } from '@polkadot/types/interfaces/system';
|
||||
|
||||
/** @name FeeDetails */
|
||||
@@ -31,4 +31,11 @@ export interface RuntimeDispatchInfoV1 extends Struct {
|
||||
readonly partialFee: Balance;
|
||||
}
|
||||
|
||||
/** @name RuntimeDispatchInfoV2 */
|
||||
export interface RuntimeDispatchInfoV2 extends Struct {
|
||||
readonly weight: WeightV2;
|
||||
readonly class: DispatchClass;
|
||||
readonly partialFee: Balance;
|
||||
}
|
||||
|
||||
export type PHANTOM_PAYMENT = 'payment';
|
||||
|
||||
Reference in New Issue
Block a user