remove unnecessary consts (#1586)

This commit is contained in:
Svyatoslav Nikolsky
2022-09-30 15:42:55 +03:00
committed by Bastian Köcher
parent 0f79d1e86e
commit 5ff36549f1
27 changed files with 29 additions and 293 deletions
@@ -11,27 +11,17 @@ smallvec = "1.7"
# Bridge Dependencies
bp-messages = { path = "../messages", default-features = false }
bp-polkadot-core = { path = "../polkadot-core", default-features = false }
bp-runtime = { path = "../runtime", default-features = false }
# Substrate Based Dependencies
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
[features]
default = ["std"]
std = [
"bp-messages/std",
"bp-polkadot-core/std",
"bp-runtime/std",
"frame-support/std",
"sp-api/std",
"sp-runtime/std",
"sp-std/std",
"sp-version/std",
]
+2 -59
View File
@@ -18,58 +18,12 @@
// RuntimeApi generated functions
#![allow(clippy::too_many_arguments)]
use bp_messages::{
InboundMessageDetails, LaneId, MessageNonce, MessagePayload, OutboundMessageDetails,
};
use frame_support::weights::{
WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial,
};
use sp_runtime::FixedU128;
use sp_std::prelude::*;
use sp_version::RuntimeVersion;
pub use bp_polkadot_core::*;
use bp_runtime::decl_bridge_runtime_apis;
use bp_runtime::decl_bridge_finality_runtime_apis;
/// Polkadot Chain
pub type Polkadot = PolkadotLike;
// NOTE: This needs to be kept up to date with the Polkadot runtime found in the Polkadot repo.
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: sp_version::create_runtime_str!("polkadot"),
impl_name: sp_version::create_runtime_str!("parity-polkadot"),
authoring_version: 0,
spec_version: 9180,
impl_version: 0,
apis: sp_version::create_apis_vec![[]],
transaction_version: 12,
state_version: 0,
};
// NOTE: This needs to be kept up to date with the Polkadot runtime found in the Polkadot repo.
pub struct WeightToFee;
impl WeightToFeePolynomial for WeightToFee {
type Balance = Balance;
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
const CENTS: Balance = 10_000_000_000 / 100;
// in Polkadot, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT:
let p = CENTS;
let q = 10 * Balance::from(ExtrinsicBaseWeight::get());
smallvec::smallvec![WeightToFeeCoefficient {
degree: 1,
negative: false,
coeff_frac: Perbill::from_rational(p % q, q),
coeff_integer: p / q,
}]
}
}
/// Per-byte fee for Polkadot transactions.
pub const TRANSACTION_BYTE_FEE: Balance = 10 * 10_000_000_000 / 100 / 1_000;
/// Existential deposit on Polkadot.
pub const EXISTENTIAL_DEPOSIT: Balance = 10_000_000_000;
/// The target length of a session (how often authorities change) on Polkadot measured in of number
/// of blocks.
///
@@ -79,16 +33,5 @@ pub const SESSION_LENGTH: BlockNumber = 4 * time_units::HOURS;
/// Name of the With-Polkadot GRANDPA pallet instance that is deployed at bridged chains.
pub const WITH_POLKADOT_GRANDPA_PALLET_NAME: &str = "BridgePolkadotGrandpa";
/// Name of the With-Polkadot messages pallet instance that is deployed at bridged chains.
pub const WITH_POLKADOT_MESSAGES_PALLET_NAME: &str = "BridgePolkadotMessages";
/// Name of the transaction payment pallet at the Polkadot runtime.
pub const TRANSACTION_PAYMENT_PALLET_NAME: &str = "TransactionPayment";
/// Name of the KSM->DOT conversion rate parameter, stored in the Polkadot runtime.
pub const KUSAMA_TO_POLKADOT_CONVERSION_RATE_PARAMETER_NAME: &str =
"KusamaToPolkadotConversionRate";
/// Name of the Kusama fee multiplier parameter, stored in the Polkadot runtime.
pub const KUSAMA_FEE_MULTIPLIER_PARAMETER_NAME: &str = "KusamaFeeMultiplier";
decl_bridge_runtime_apis!(polkadot);
decl_bridge_finality_runtime_apis!(polkadot);