From f5a9d2735f1839ccc43666c302cf8c3eb8e46de1 Mon Sep 17 00:00:00 2001 From: lemunozm Date: Tue, 12 Sep 2023 09:24:29 +0200 Subject: [PATCH] fix rate type used in runtime api for pools --- runtime/altair/src/lib.rs | 8 ++++---- runtime/centrifuge/src/lib.rs | 8 ++++---- runtime/development/src/lib.rs | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/runtime/altair/src/lib.rs b/runtime/altair/src/lib.rs index f26008d6c5..5267efc480 100644 --- a/runtime/altair/src/lib.rs +++ b/runtime/altair/src/lib.rs @@ -2123,7 +2123,7 @@ impl_runtime_apis! { } } - impl runtime_common::apis::PoolsApi for Runtime { + impl runtime_common::apis::PoolsApi for Runtime { fn currency(pool_id: PoolId) -> Option{ pallet_pool_system::Pool::::get(pool_id).map(|details| details.currency) } @@ -2138,7 +2138,7 @@ impl_runtime_apis! { ).ok() } - fn tranche_token_price(pool_id: PoolId, tranche: TrancheLoc) -> Option{ + fn tranche_token_price(pool_id: PoolId, tranche: TrancheLoc) -> Option{ let now = ::now().as_secs(); let mut pool = PoolSystem::pool(pool_id)?; let nav = Loans::update_nav(pool_id).ok()?; @@ -2151,14 +2151,14 @@ impl_runtime_apis! { prices.get(index).cloned() } - fn tranche_token_prices(pool_id: PoolId) -> Option>{ + fn tranche_token_prices(pool_id: PoolId) -> Option>{ let now = ::now().as_secs(); let mut pool = PoolSystem::pool(pool_id)?; let nav = Loans::update_nav(pool_id).ok()?; let total_assets = pool.reserve.total.saturating_add(nav); pool .tranches - .calculate_prices::(total_assets, now) + .calculate_prices::<_, OrmlTokens, AccountId>(total_assets, now) .ok() } diff --git a/runtime/centrifuge/src/lib.rs b/runtime/centrifuge/src/lib.rs index 76574a5697..02a8ebf0f9 100644 --- a/runtime/centrifuge/src/lib.rs +++ b/runtime/centrifuge/src/lib.rs @@ -2189,7 +2189,7 @@ impl_runtime_apis! { } // PoolsApi - impl runtime_common::apis::PoolsApi for Runtime { + impl runtime_common::apis::PoolsApi for Runtime { fn currency(pool_id: PoolId) -> Option{ pallet_pool_system::Pool::::get(pool_id).map(|details| details.currency) } @@ -2204,7 +2204,7 @@ impl_runtime_apis! { ).ok() } - fn tranche_token_price(pool_id: PoolId, tranche: TrancheLoc) -> Option{ + fn tranche_token_price(pool_id: PoolId, tranche: TrancheLoc) -> Option{ let now = ::now().as_secs(); let mut pool = PoolSystem::pool(pool_id)?; let nav = Loans::update_nav(pool_id).ok()?; @@ -2217,14 +2217,14 @@ impl_runtime_apis! { prices.get(index).cloned() } - fn tranche_token_prices(pool_id: PoolId) -> Option>{ + fn tranche_token_prices(pool_id: PoolId) -> Option>{ let now = ::now().as_secs(); let mut pool = PoolSystem::pool(pool_id)?; let nav = Loans::update_nav(pool_id).ok()?; let total_assets = pool.reserve.total.saturating_add(nav); pool .tranches - .calculate_prices::(total_assets, now) + .calculate_prices::<_, Tokens, AccountId>(total_assets, now) .ok() } diff --git a/runtime/development/src/lib.rs b/runtime/development/src/lib.rs index 082fb149a9..9fde19fbdd 100644 --- a/runtime/development/src/lib.rs +++ b/runtime/development/src/lib.rs @@ -2209,7 +2209,7 @@ impl_runtime_apis! { } // PoolsApi - impl runtime_common::apis::PoolsApi for Runtime { + impl runtime_common::apis::PoolsApi for Runtime { fn currency(pool_id: PoolId) -> Option{ pallet_pool_system::Pool::::get(pool_id).map(|details| details.currency) } @@ -2224,7 +2224,7 @@ impl_runtime_apis! { ).ok() } - fn tranche_token_price(pool_id: PoolId, tranche: TrancheLoc) -> Option{ + fn tranche_token_price(pool_id: PoolId, tranche: TrancheLoc) -> Option{ let now = ::now().as_secs(); let mut pool = PoolSystem::pool(pool_id)?; let nav = Loans::update_nav(pool_id).ok()?; @@ -2237,14 +2237,14 @@ impl_runtime_apis! { prices.get(index).cloned() } - fn tranche_token_prices(pool_id: PoolId) -> Option>{ + fn tranche_token_prices(pool_id: PoolId) -> Option>{ let now = ::now().as_secs(); let mut pool = PoolSystem::pool(pool_id)?; let nav = Loans::update_nav(pool_id).ok()?; let total_assets = pool.reserve.total.saturating_add(nav); pool .tranches - .calculate_prices::(total_assets, now) + .calculate_prices::<_, OrmlTokens, AccountId>(total_assets, now) .ok() }