Runtime definition cleanups (& CHANGELOG) (#5450)
* Runtime definition cleanups (& CHANGELOG) * Adjust to pre-v3 levels * Full CHANGELOG
This commit is contained in:
@@ -2,9 +2,17 @@
|
||||
|
||||
## master
|
||||
|
||||
Contributed:
|
||||
|
||||
- Add support for V3 of `TransactionPaymentApi` (Thanks to https://github.com/notlesh)
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust `Weight` alias detection (moved from `PortableRegistry` -> `Registry`)
|
||||
- Move default (typegen) weight alias to `WeightV2` (does not affect runtime detection)
|
||||
- Prepare metadata docs from chain generation for future cli arguments
|
||||
- Add base type object for (future) composite types
|
||||
- Apply additional JSDoc comments into `PortaleRegistry`
|
||||
|
||||
|
||||
## 9.12.1 Jan 22, 2023
|
||||
|
||||
@@ -340,9 +340,9 @@ declare module '@polkadot/api-base/types/calls' {
|
||||
**/
|
||||
queryFeeDetails: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<FeeDetails>>;
|
||||
/**
|
||||
* The call info
|
||||
* The transaction info
|
||||
**/
|
||||
queryInfo: AugmentedCall<ApiType, (call: Call | IMethod | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<RuntimeDispatchInfo>>;
|
||||
queryInfo: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<RuntimeDispatchInfo>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
|
||||
@@ -340,9 +340,9 @@ declare module '@polkadot/api-base/types/calls' {
|
||||
**/
|
||||
queryFeeDetails: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<FeeDetails>>;
|
||||
/**
|
||||
* The call info
|
||||
* The transaction info
|
||||
**/
|
||||
queryInfo: AugmentedCall<ApiType, (call: Call | IMethod | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<RuntimeDispatchInfo>>;
|
||||
queryInfo: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<RuntimeDispatchInfo>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
|
||||
@@ -271,9 +271,9 @@ declare module '@polkadot/api-base/types/calls' {
|
||||
**/
|
||||
queryFeeDetails: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<FeeDetails>>;
|
||||
/**
|
||||
* The call info
|
||||
* The transaction info
|
||||
**/
|
||||
queryInfo: AugmentedCall<ApiType, (call: Call | IMethod | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<RuntimeDispatchInfo>>;
|
||||
queryInfo: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<RuntimeDispatchInfo>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
|
||||
@@ -39,13 +39,13 @@ const V1_V2_V3_SHARED_CALL: Record<string, DefinitionCall> = {
|
||||
}
|
||||
};
|
||||
|
||||
const V2_V3_SHARED_QUERY_INFO: Record<string, DefinitionCall> = {
|
||||
const V2_V3_SHARED_PAY: Record<string, DefinitionCall> = {
|
||||
query_info: {
|
||||
description: 'The call info',
|
||||
description: 'The transaction info',
|
||||
params: [
|
||||
{
|
||||
name: 'call',
|
||||
type: 'Call'
|
||||
name: 'uxt',
|
||||
type: 'Extrinsic'
|
||||
},
|
||||
{
|
||||
name: 'len',
|
||||
@@ -56,7 +56,7 @@ const V2_V3_SHARED_QUERY_INFO: Record<string, DefinitionCall> = {
|
||||
}
|
||||
};
|
||||
|
||||
const V2_V3_SHARED_QUERY_CALL_INFO: Record<string, DefinitionCall> = {
|
||||
const V2_V3_SHARED_CALL: Record<string, DefinitionCall> = {
|
||||
query_call_info: {
|
||||
description: 'The call info',
|
||||
params: [
|
||||
@@ -73,7 +73,17 @@ const V2_V3_SHARED_QUERY_CALL_INFO: Record<string, DefinitionCall> = {
|
||||
}
|
||||
};
|
||||
|
||||
const V3_QUERY_WEIGHT_TO_FEE: Record<string, DefinitionCall> = {
|
||||
const V3_SHARED_PAY_CALL: Record<string, DefinitionCall> = {
|
||||
query_length_to_fee: {
|
||||
description: 'Query the output of the current LengthToFee given some input',
|
||||
params: [
|
||||
{
|
||||
name: 'length',
|
||||
type: 'u32'
|
||||
}
|
||||
],
|
||||
type: 'Balance'
|
||||
},
|
||||
query_weight_to_fee: {
|
||||
description: 'Query the output of the current WeightToFee given some input',
|
||||
params: [
|
||||
@@ -86,27 +96,13 @@ const V3_QUERY_WEIGHT_TO_FEE: Record<string, DefinitionCall> = {
|
||||
}
|
||||
};
|
||||
|
||||
const V3_QUERY_LENGTH_TO_FEE: Record<string, DefinitionCall> = {
|
||||
query_length_to_fee: {
|
||||
description: 'Query the output of the current LengthToFee given some input',
|
||||
params: [
|
||||
{
|
||||
name: 'length',
|
||||
type: 'u32'
|
||||
}
|
||||
],
|
||||
type: 'Balance'
|
||||
}
|
||||
};
|
||||
|
||||
export const runtime: DefinitionsCall = {
|
||||
TransactionPaymentApi: [
|
||||
{
|
||||
methods: objectSpread(
|
||||
{},
|
||||
V3_QUERY_WEIGHT_TO_FEE,
|
||||
V3_QUERY_LENGTH_TO_FEE,
|
||||
V2_V3_SHARED_QUERY_INFO,
|
||||
V3_SHARED_PAY_CALL,
|
||||
V2_V3_SHARED_PAY,
|
||||
V1_V2_V3_SHARED_PAY
|
||||
),
|
||||
version: 3
|
||||
@@ -114,7 +110,7 @@ export const runtime: DefinitionsCall = {
|
||||
{
|
||||
methods: objectSpread(
|
||||
{},
|
||||
V2_V3_SHARED_QUERY_INFO,
|
||||
V2_V3_SHARED_PAY,
|
||||
V1_V2_V3_SHARED_PAY
|
||||
),
|
||||
version: 2
|
||||
@@ -136,7 +132,6 @@ export const runtime: DefinitionsCall = {
|
||||
// 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_V3_SHARED_PAY),
|
||||
@@ -147,9 +142,8 @@ export const runtime: DefinitionsCall = {
|
||||
{
|
||||
methods: objectSpread(
|
||||
{},
|
||||
V3_QUERY_WEIGHT_TO_FEE,
|
||||
V3_QUERY_LENGTH_TO_FEE,
|
||||
V2_V3_SHARED_QUERY_CALL_INFO,
|
||||
V3_SHARED_PAY_CALL,
|
||||
V2_V3_SHARED_CALL,
|
||||
V1_V2_V3_SHARED_CALL
|
||||
),
|
||||
version: 3
|
||||
@@ -157,14 +151,14 @@ export const runtime: DefinitionsCall = {
|
||||
{
|
||||
methods: objectSpread(
|
||||
{},
|
||||
V2_V3_SHARED_QUERY_CALL_INFO,
|
||||
V2_V3_SHARED_CALL,
|
||||
V1_V2_V3_SHARED_CALL
|
||||
),
|
||||
version: 2
|
||||
},
|
||||
{
|
||||
methods: objectSpread({
|
||||
query_call_info: {
|
||||
CALL: {
|
||||
description: 'The call info',
|
||||
params: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user