From bf97ee805ed145ed527fe03dd076b427e4e05234 Mon Sep 17 00:00:00 2001 From: William Freudenberger Date: Thu, 5 Sep 2024 15:51:02 +0200 Subject: [PATCH] fix: mut --- .../common/src/migrations/liquidity_pools_v2.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/runtime/common/src/migrations/liquidity_pools_v2.rs b/runtime/common/src/migrations/liquidity_pools_v2.rs index 095e39cd57..4d52c57158 100644 --- a/runtime/common/src/migrations/liquidity_pools_v2.rs +++ b/runtime/common/src/migrations/liquidity_pools_v2.rs @@ -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::::kill(); pallet_liquidity_pools_gateway_queue::MessageNonceStore::::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)) @@ -310,7 +310,7 @@ pub mod v0_init_message_queue { Message = GatewayMessage, >, { - fn migrate_message_queue(mut reads: u64, mut writes: u64) { + fn migrate_message_queue(reads: &mut u64, writes: &mut u64) { let n: u64 = FailedOutboundMessages::::iter_keys() .count() .saturated_into(); @@ -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::::iter_keys() .count() .saturated_into();