fix pr comments

This commit is contained in:
akildemir
2024-06-28 16:17:57 +03:00
parent f75fe67493
commit c14923facb
17 changed files with 257 additions and 284 deletions

View File

@@ -30,10 +30,10 @@ impl From<Call> for RuntimeCall {
}
},
Call::LiquidityTokens(lt) => match lt {
serai_abi::coins::LiquidityTokensCall::transfer { to, balance } => {
serai_abi::liquidity_tokens::Call::transfer { to, balance } => {
RuntimeCall::LiquidityTokens(coins::Call::transfer { to: to.into(), balance })
}
serai_abi::coins::LiquidityTokensCall::burn { balance } => {
serai_abi::liquidity_tokens::Call::burn { balance } => {
RuntimeCall::LiquidityTokens(coins::Call::burn { balance })
}
},
@@ -220,9 +220,9 @@ impl TryInto<Call> for RuntimeCall {
}),
RuntimeCall::LiquidityTokens(call) => Call::LiquidityTokens(match call {
coins::Call::transfer { to, balance } => {
serai_abi::coins::LiquidityTokensCall::transfer { to: to.into(), balance }
serai_abi::liquidity_tokens::Call::transfer { to: to.into(), balance }
}
coins::Call::burn { balance } => serai_abi::coins::LiquidityTokensCall::burn { balance },
coins::Call::burn { balance } => serai_abi::liquidity_tokens::Call::burn { balance },
_ => Err(())?,
}),
RuntimeCall::Dex(call) => Call::Dex(match call {

View File

@@ -48,7 +48,11 @@ use sp_runtime::{
BoundedVec, Perbill, ApplyExtrinsicResult,
};
use primitives::{NetworkId, PublicKey, AccountLookup, SubstrateAmount, Coin, NETWORKS};
#[allow(unused_imports)]
use primitives::{
NetworkId, PublicKey, AccountLookup, SubstrateAmount, Coin, NETWORKS, MEDIAN_PRICE_WINDOW_LENGTH,
HOURS, DAYS, MINUTES, TARGET_BLOCK_TIME, BLOCK_SIZE,
};
use support::{
traits::{ConstU8, ConstU16, ConstU32, ConstU64, Contains},
@@ -115,28 +119,7 @@ pub fn native_version() -> NativeVersion {
NativeVersion { runtime_version: VERSION, can_author_with: Default::default() }
}
// 1 MB
pub const BLOCK_SIZE: u32 = 1024 * 1024;
// 6 seconds
pub const TARGET_BLOCK_TIME: u64 = 6;
/// Measured in blocks.
pub const MINUTES: BlockNumber = 60 / TARGET_BLOCK_TIME;
pub const HOURS: BlockNumber = MINUTES * 60;
pub const DAYS: BlockNumber = HOURS * 24;
pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4);
/// This needs to be long enough for arbitrage to occur and make holding any fake price up
/// sufficiently unrealistic.
#[allow(clippy::cast_possible_truncation)]
pub const ARBITRAGE_TIME: u16 = (2 * HOURS) as u16;
/// Since we use the median price, double the window length.
///
/// We additionally +1 so there is a true median.
pub const MEDIAN_PRICE_WINDOW_LENGTH: u16 = (2 * ARBITRAGE_TIME) + 1;
pub const BABE_GENESIS_EPOCH_CONFIG: sp_consensus_babe::BabeEpochConfiguration =
sp_consensus_babe::BabeEpochConfiguration {
c: PRIMARY_PROBABILITY,
@@ -295,7 +278,7 @@ pub type ReportLongevity = <Runtime as pallet_babe::Config>::EpochDuration;
impl babe::Config for Runtime {
#[cfg(feature = "fast-epoch")]
type EpochDuration = ConstU64<{ HOURS / 2 }>; // 30 minutes
type EpochDuration = ConstU64<{ MINUTES / 2 }>; // 30 seconds
#[cfg(not(feature = "fast-epoch"))]
type EpochDuration = ConstU64<{ 4 * 7 * DAYS }>;