From df3329453c865a95b7e990f40c9d542f2b4ba4ba Mon Sep 17 00:00:00 2001 From: Milosz Muszynski Date: Tue, 27 Feb 2024 17:56:00 +0100 Subject: [PATCH] rusk: added slashed amount migration rusk: formatting --- rusk/src/lib/chain/vm/migration.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/rusk/src/lib/chain/vm/migration.rs b/rusk/src/lib/chain/vm/migration.rs index c9c6cb38e0..687455cb19 100644 --- a/rusk/src/lib/chain/vm/migration.rs +++ b/rusk/src/lib/chain/vm/migration.rs @@ -14,7 +14,7 @@ use tracing::info; const MIGRATION_GAS_LIMIT: u64 = 1_000_000_000; const NEW_STAKE_CONTRACT_BYTECODE: &[u8] = include_bytes!( - "../../../../../target/wasm32-unknown-unknown/release/stake_contract_v2.wasm" + "../../../../../target/wasm32-unknown-unknown/release/stake_contract.wasm" ); pub struct Migration; @@ -72,6 +72,22 @@ impl Migration { MIGRATION_GAS_LIMIT, )?; } + let slashed_amount = session + .call::<_, u64>( + old_contract, + "slashed_amount", + &(), + MIGRATION_GAS_LIMIT, + )? + .data; + session + .call::<_, ()>( + new_contract, + "set_slashed_amount", + &slashed_amount, + MIGRATION_GAS_LIMIT, + )? + .data; Ok(()) }