Skip to content

Commit 528f945

Browse files
authored
Fix Price Tools denomination (#1334)
1 parent eb7800f commit 528f945

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

pallets/price-tools/src/lib.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -589,22 +589,21 @@ impl<T: Config> OnDenominate<BalanceOf<T>> for DenominateXorAndTbcd<T> {
589589
fn on_denominate(_factor: &BalanceOf<T>) -> DispatchResult {
590590
frame_support::log::info!("{}::on_denominate({})", module_path!(), _factor);
591591

592-
let clear_price_info = |asset_id: AssetIdOf<T>| {
592+
for asset_id in PriceInfos::<T>::iter_keys() {
593593
PriceInfos::<T>::mutate(asset_id, |price_info| {
594594
if let Some(info) = price_info {
595595
*info = AggregatedPriceInfo::default();
596596
}
597597
});
598+
}
598599

599-
FastPriceInfos::<T>::mutate(asset_id, |fast_price_info| {
600-
if let Some(info) = fast_price_info {
600+
for asset_id in FastPriceInfos::<T>::iter_keys() {
601+
FastPriceInfos::<T>::mutate(asset_id, |price_info| {
602+
if let Some(info) = price_info {
601603
*info = AggregatedPriceInfo::default();
602604
}
603605
});
604-
};
605-
606-
clear_price_info(AssetIdOf::<T>::from(XOR));
607-
clear_price_info(AssetIdOf::<T>::from(common::TBCD));
606+
}
608607

609608
Ok(())
610609
}

0 commit comments

Comments
 (0)