mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 13:48:00 +00:00
payment_queryInfo: Make it work with WeightV2 (#12633)
* `payment_queryInfo`: Make it work with `WeighV2` The runtime api for querying the payment info depends on the `Weight` type and broke for old runtimes that still use the `WeighV1`. This pull requests fixes this by: 1. Bumping the version of the runtime api. 2. Making the node side code use the correct runtime api function depending on the version of the runtime api. 3. Make the RPC always return `WeighV1`. Users of the api should switch to `state_call` and decide based on the version of the runtime api which `Weight` type is being returned. * Fix tests * Review comment
This commit is contained in:
@@ -26,8 +26,6 @@
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
extern crate self as sp_weights;
|
||||
|
||||
mod weight_v2;
|
||||
|
||||
use codec::{CompactAs, Decode, Encode, MaxEncodedLen};
|
||||
@@ -70,6 +68,8 @@ pub mod constants {
|
||||
MaxEncodedLen,
|
||||
TypeInfo,
|
||||
)]
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
#[cfg_attr(feature = "std", serde(transparent))]
|
||||
pub struct OldWeight(pub u64);
|
||||
|
||||
/// The weight of database operations that the runtime can invoke.
|
||||
@@ -106,7 +106,7 @@ impl RuntimeDbWeight {
|
||||
/// coeff_integer * x^(degree) + coeff_frac * x^(degree)
|
||||
/// ```
|
||||
///
|
||||
/// The `negative` value encodes whether the term is added or substracted from the
|
||||
/// The `negative` value encodes whether the term is added or subtracted from the
|
||||
/// overall polynomial result.
|
||||
#[derive(Clone, Encode, Decode, TypeInfo)]
|
||||
pub struct WeightToFeeCoefficient<Balance> {
|
||||
|
||||
Reference in New Issue
Block a user