From 5fc046579ab90d453763bdc3177e537e002e5c07 Mon Sep 17 00:00:00 2001 From: Frederik Gartenmeister Date: Tue, 21 May 2024 20:53:13 +0200 Subject: [PATCH] feat: add oracle key (#1841) --- libs/types/src/oracles.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/types/src/oracles.rs b/libs/types/src/oracles.rs index 7e6252591c..4beba3e804 100644 --- a/libs/types/src/oracles.rs +++ b/libs/types/src/oracles.rs @@ -1,3 +1,4 @@ +use cfg_primitives::{LoanId, PoolId}; use frame_support::pallet_prelude::RuntimeDebug; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; @@ -26,10 +27,18 @@ pub type Isin = [u8; 12]; #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub enum OracleKey { /// Identify a Isin price + #[codec(index = 0)] Isin(Isin), /// Identify a conversion from the first currency to the second one + #[codec(index = 1)] ConversionRatio(CurrencyId, CurrencyId), + + /// Identifies a single pool-loan-id combination. + /// This key is a fallback solution if no other keys are applicable for the + /// given oracle. + #[codec(index = 2)] + PoolLoanId(PoolId, LoanId), } impl From<(CurrencyId, CurrencyId)> for OracleKey {