Skip to content

Commit

Permalink
remove WeightToFee mock
Browse files Browse the repository at this point in the history
  • Loading branch information
ipapandinas committed Dec 4, 2024
1 parent 1f400a4 commit 633982f
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions tests/integration/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub use shibuya::*;
#[cfg(feature = "shibuya")]
mod shibuya {
use super::*;
pub use shibuya_runtime::WeightToFee;
pub use shibuya_runtime::*;

/// 1 SBY.
Expand Down Expand Up @@ -82,6 +83,7 @@ mod shibuya {
pub use shiden::*;
#[cfg(feature = "shiden")]
mod shiden {
pub use shiden_runtime::WeightToFee;
pub use shiden_runtime::*;

/// 1 SDN.
Expand All @@ -92,6 +94,7 @@ mod shiden {
pub use astar::*;
#[cfg(feature = "astar")]
mod astar {
pub use astar_runtime::WeightToFee;
pub use astar_runtime::*;

/// 1 ASTR.
Expand Down Expand Up @@ -374,21 +377,3 @@ pub fn call_wasm_contract_method<V: Decode>(
);
value
}

/// TODO: improve WeightToFee later once code is more accessible.
/// Same `WeightToFee` implementation as runtime
pub struct WeightToFee;
impl WeightToFeePolynomial for WeightToFee {
type Balance = Balance;
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
let p = WeightFeeFactor::get();
let q = Balance::from(ExtrinsicBaseWeight::get().ref_time());
smallvec::smallvec![WeightToFeeCoefficient {
degree: 1,
negative: false,
coeff_frac: Perbill::from_rational(p % q, q),
coeff_integer: p / q,
}]
}
}

0 comments on commit 633982f

Please sign in to comment.