mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Merge branch 'develop' into next
This is an initial resolution of conflicts which does not work.
This commit is contained in:
@@ -53,8 +53,9 @@ use sp_runtime::{
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use primitives::{
|
||||
NetworkId, PublicKey, AccountLookup, SubstrateAmount, Coin, NETWORKS, MEDIAN_PRICE_WINDOW_LENGTH,
|
||||
HOURS, DAYS, MINUTES, TARGET_BLOCK_TIME, BLOCK_SIZE, FAST_EPOCH_DURATION,
|
||||
NetworkId, PublicKey, AccountLookup, SubstrateAmount, Coin, EXTERNAL_NETWORKS,
|
||||
MEDIAN_PRICE_WINDOW_LENGTH, HOURS, DAYS, MINUTES, TARGET_BLOCK_TIME, BLOCK_SIZE,
|
||||
FAST_EPOCH_DURATION,
|
||||
};
|
||||
|
||||
use support::{
|
||||
@@ -570,10 +571,7 @@ sp_api::impl_runtime_apis! {
|
||||
.map(|(id, _)| id.into_inner().0)
|
||||
.collect::<hashbrown::HashSet<_>>();
|
||||
let mut all = serai_validators;
|
||||
for network in NETWORKS {
|
||||
if network == NetworkId::Serai {
|
||||
continue;
|
||||
}
|
||||
for network in EXTERNAL_NETWORKS {
|
||||
// Returning the latest-decided, not latest and active, means the active set
|
||||
// may fail to peer find if there isn't sufficient overlap. If a large amount reboot,
|
||||
// forcing some validators to successfully peer find in order for the threshold to become
|
||||
@@ -581,7 +579,7 @@ sp_api::impl_runtime_apis! {
|
||||
//
|
||||
// This is assumed not to matter in real life, yet an interesting note.
|
||||
let participants =
|
||||
ValidatorSets::participants_for_latest_decided_set(network)
|
||||
ValidatorSets::participants_for_latest_decided_set(NetworkId::from(network))
|
||||
.map_or(vec![], BoundedVec::into_inner);
|
||||
for (participant, _) in participants {
|
||||
all.insert(participant.0);
|
||||
@@ -610,25 +608,25 @@ sp_api::impl_runtime_apis! {
|
||||
|
||||
impl dex::DexApi<Block> for Runtime {
|
||||
fn quote_price_exact_tokens_for_tokens(
|
||||
asset1: Coin,
|
||||
asset2: Coin,
|
||||
coin1: Coin,
|
||||
coin2: Coin,
|
||||
amount: SubstrateAmount,
|
||||
include_fee: bool
|
||||
) -> Option<SubstrateAmount> {
|
||||
Dex::quote_price_exact_tokens_for_tokens(asset1, asset2, amount, include_fee)
|
||||
Dex::quote_price_exact_tokens_for_tokens(coin1, coin2, amount, include_fee)
|
||||
}
|
||||
|
||||
fn quote_price_tokens_for_exact_tokens(
|
||||
asset1: Coin,
|
||||
asset2: Coin,
|
||||
coin1: Coin,
|
||||
coin2: Coin,
|
||||
amount: SubstrateAmount,
|
||||
include_fee: bool
|
||||
) -> Option<SubstrateAmount> {
|
||||
Dex::quote_price_tokens_for_exact_tokens(asset1, asset2, amount, include_fee)
|
||||
Dex::quote_price_tokens_for_exact_tokens(coin1, coin2, amount, include_fee)
|
||||
}
|
||||
|
||||
fn get_reserves(asset1: Coin, asset2: Coin) -> Option<(SubstrateAmount, SubstrateAmount)> {
|
||||
Dex::get_reserves(&asset1, &asset2).ok()
|
||||
fn get_reserves(coin1: Coin, coin2: Coin) -> Option<(SubstrateAmount, SubstrateAmount)> {
|
||||
Dex::get_reserves(&coin1, &coin2).ok()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user