Runtime definition cleanups (& CHANGELOG) (#5450)

* Runtime definition cleanups (& CHANGELOG)

* Adjust to pre-v3 levels

* Full CHANGELOG
This commit is contained in:
Jaco
2023-01-28 09:07:44 +02:00
committed by GitHub
parent f7ad6e09ed
commit b544f24bcf
5 changed files with 37 additions and 35 deletions
@@ -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: [
{