-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: manual oracle activation #782
Conversation
Crate versions that have not been updated:
Crate versions that have been updated:
Runtime version has been increased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please document new extrinsics
pallets/ema-oracle/src/lib.rs
Outdated
#[pallet::generate_deposit(pub(crate) fn deposit_event)] | ||
pub enum Event<T: Config> { | ||
/// Oracle was added to the whitelist. | ||
OracleAdded { source: Source, assets: (AssetId, AssetId) }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when you add event like this, i would expect it being fired every time oracle is created, not just when you modify whitelist
|
||
#[pallet::call_index(1)] | ||
#[pallet::weight(<T as Config>::WeightInfo::remove_oracle())] | ||
pub fn remove_oracle(origin: OriginFor<T>, source: Source, assets: (AssetId, AssetId)) -> DispatchResult { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would expect this function would remove actual oracle as well, not just item from whitelist
pallets/ema-oracle/src/lib.rs
Outdated
@@ -243,7 +294,10 @@ impl<T: Config> Pallet<T> { | |||
assets: (AssetId, AssetId), | |||
oracle_entry: OracleEntry<BlockNumberFor<T>>, | |||
) -> Result<(), ()> { | |||
if !T::OracleWhitelist::contains(&(src, assets.0, assets.1)) { | |||
if !(T::OracleWhitelist::contains(&(src, assets.0, assets.1)) | |||
|| WhitelistedAssets::<T>::get().contains(&(src, (assets.0, assets.1)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont like the way this is tacked on, from configuration of the pallet i would expect that only OracleWhitelist
controls it, nothing else, therefore this list should be only contains implementation (default ()) so if you override it in config, it wont be utilized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so for our case you would basically implement extension in the runtime config (extend sufficient asset filter), not other way around
# Conflicts: # Cargo.lock # integration-tests/Cargo.toml # pallets/asset-registry/Cargo.toml
Fixes #771