Closed clangenb closed 1 year ago
Weather oracle : Temperature, Amount of precipitation at a location
/// Any string value from different sources
#[pallet::storage]
#[pallet::getter(fn some_nmap)]
pub(super) type GeneralStringValues <T: Config> = StorageNMap<
_,
(
NMapKey<Blake2_128Concat, GeneralStringKey>, //Temperature or Precipitation
NMapKey<Blake2_128Concat, GeneralStringKey >, //Zurich or London
NMapKey< Blake2_128Concat, DataSourceString >, //https:….
),
GeneralStringValue,
ValueQuery, //
>;
With:
pub type GeneralStringKey= PalletString;
pub type DataSourceString = PalletString;
pub type GeneralStringValue = PalletString;
In this case we would need an update function:
pub fn update_general_string_value(
origin: OriginFor<T>,
data_source: DataSourceString,
key_1: GeneralStringKey,
key_2: GeneralStringKey,
new_value: Option< GeneralStringValue >,
) -> DispatchResultWithPostInfo {…}
and new events and errors.
The worker needs to be reworked, it is not generic enough, but specific to the exchange rate oracle:
Discussed with @clangenb
The extended demo will make use of at least one additional oracle such as a weather oracle as stated above by @echevrier.
The extended oracle will use a new more generic structure by adapting the app-libs/exchange-oracle
as well as the enclave-runtime/Teeracle
to be more accommodating to making generic requests untied to exchange rates.
The long tail goal of the Teeracle demo will be to make it far more configurable either via indirect or direct invocation configuration. For now a clear path to adding additional oracles outside the realm of exchanges is what is required for completion.
Requesting to close from @clangenb if this suffices
Now that I read this again, I suggest that we close it, when we have the demo ready. However, I agree with what has been written. :)
Just a mention, here is the pallet-side PR for this: https://github.com/integritee-network/pallets/pull/109
Agreed!
Done!
We would like to extend our teeracle demo case to go beyond of trading pairs:
Ideas:
Then we could: