From f21f826746036993085aac4df047b1c038db2eba 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/src/lib/chain/vm/migration.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rusk/src/lib/chain/vm/migration.rs b/rusk/src/lib/chain/vm/migration.rs index c9c6cb38e0..e406f3cf14 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,18 @@ 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(()) }