Skip to content

Commit

Permalink
rusk-recovery: Add Dusk's VM
Browse files Browse the repository at this point in the history
  • Loading branch information
moCello committed Dec 20, 2024
1 parent b25cd08 commit cb788b7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rusk-recovery/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use dusk_core::stake::{StakeAmount, StakeData, StakeKeys, STAKE_CONTRACT};
use dusk_core::transfer::phoenix::{Note, PublicKey, Sender};
use dusk_core::transfer::TRANSFER_CONTRACT;
use dusk_core::JubJubScalar;
use dusk_vm::{ContractData, Session, VM};
use dusk_vm::{new_genesis_session, new_session, ContractData, Session, VM};
use ff::Field;
use once_cell::sync::Lazy;
use rand::rngs::StdRng;
Expand Down Expand Up @@ -176,8 +176,8 @@ fn generate_empty_state<P: AsRef<Path>>(

let state_dir = state_dir.as_ref();

let vm = dusk_vm::new_vm(state_dir)?;
let mut session = dusk_vm::new_genesis_session(&vm, GENESIS_CHAIN_ID);
let vm = VM::new(state_dir)?;
let mut session = new_genesis_session(&vm, GENESIS_CHAIN_ID);

let transfer_code = include_bytes!(
"../../target/dusk/wasm64-unknown-unknown/release/transfer_contract.wasm"
Expand Down Expand Up @@ -260,7 +260,7 @@ where
None => generate_empty_state(state_dir, snapshot),
}?;

let mut session = dusk_vm::new_session(
let mut session = new_session(
&vm,
old_commit_id,
GENESIS_CHAIN_ID,
Expand Down Expand Up @@ -312,7 +312,7 @@ pub fn restore_state<P: AsRef<Path>>(
let mut commit_id = [0u8; 32];
commit_id.copy_from_slice(&commit_id_bytes);

let vm = dusk_vm::new_vm(state_dir)?;
let vm = VM::new(state_dir)?;
Ok((vm, commit_id))
}

Expand Down

0 comments on commit cb788b7

Please sign in to comment.