Skip to content

Commit

Permalink
Merge pull request #523 from bifrost-finance/slp-xcm-v3
Browse files Browse the repository at this point in the history
fix on_initialize counter
  • Loading branch information
herryho authored Mar 31, 2022
2 parents 022bb40 + 161e0b3 commit ebbc065
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pallets/slp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,10 @@ pub mod pallet {

// Deal with DelegatorLedgerXcmUpdateQueue storage
for query_id in DelegatorLedgerXcmUpdateQueue::<T>::iter_keys() {
ensure!(counter <= T::MaxTypeEntryPerBlock::get(), Error::<T>::GreaterThanMaximum);
if counter >= T::MaxTypeEntryPerBlock::get() {
break;
}

let updated = Self::get_ledger_update_agent_then_process(query_id, false)?;
if updated {
counter = counter.saturating_add(1);
Expand All @@ -1702,7 +1705,9 @@ pub mod pallet {

// Deal with ValidatorsByDelegator storage
for query_id in ValidatorsByDelegatorXcmUpdateQueue::<T>::iter_keys() {
ensure!(counter <= T::MaxTypeEntryPerBlock::get(), Error::<T>::GreaterThanMaximum);
if counter >= T::MaxTypeEntryPerBlock::get() {
break;
}
let updated =
Self::get_validators_by_delegator_update_agent_then_process(query_id, false)?;

Expand Down

0 comments on commit ebbc065

Please sign in to comment.