Skip to content

Commit

Permalink
fix: mut
Browse files Browse the repository at this point in the history
  • Loading branch information
wischli committed Sep 5, 2024
1 parent 0b8a1a6 commit bf97ee8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions runtime/common/src/migrations/liquidity_pools_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,14 @@ pub mod v0_init_message_queue {
>,
{
fn on_runtime_upgrade() -> Weight {
let reads = 0u64;
let writes = 0u64;
let mut reads = 0u64;
let mut writes = 0u64;
OutboundMessageNonceStore::<T>::kill();

pallet_liquidity_pools_gateway_queue::MessageNonceStore::<T>::put(0u64);
Self::migrate_message_queue(reads, writes);
Self::migrate_failed_message_queue(reads, writes);
log::info!("{LOG_PREFIX}: Migration done!");
Self::migrate_message_queue(&mut reads, &mut writes);
Self::migrate_failed_message_queue(&mut reads, &mut writes);
log::info!("{LOG_PREFIX}: Migration done with {reads} reads and {writes} writes!");

// Add weight from killing and setting nonce store
T::DbWeight::get().reads_writes(reads.saturating_add(1), writes.saturating_add(2))
Expand Down Expand Up @@ -310,7 +310,7 @@ pub mod v0_init_message_queue {
Message = GatewayMessage<Message, RouterId>,
>,
{
fn migrate_message_queue(mut reads: u64, mut writes: u64) {
fn migrate_message_queue(reads: &mut u64, writes: &mut u64) {
let n: u64 = FailedOutboundMessages::<T>::iter_keys()
.count()
.saturated_into();
Expand All @@ -337,7 +337,7 @@ pub mod v0_init_message_queue {
}
}

fn migrate_failed_message_queue(mut reads: u64, mut writes: u64) {
fn migrate_failed_message_queue(reads: &mut u64, writes: &mut u64) {
let n: u64 = FailedOutboundMessages::<T>::iter_keys()
.count()
.saturated_into();
Expand Down

0 comments on commit bf97ee8

Please sign in to comment.