Skip to content

Commit

Permalink
rusk: added slashed amount migration
Browse files Browse the repository at this point in the history
rusk: formatting
  • Loading branch information
miloszm committed Feb 27, 2024
1 parent 0942b25 commit df33294
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion rusk/src/lib/chain/vm/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(())
}

Expand Down

0 comments on commit df33294

Please sign in to comment.