Skip to content

Commit

Permalink
call cumu deposit from vm genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Nov 7, 2023
1 parent 9fa45c1 commit 7cf645b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion tools/genesis/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use libra_types::{legacy_types::legacy_recovery::LegacyRecovery, ol_progress::OL
use crate::{
genesis_functions::{
genesis_migrate_community_wallet, rounding_mint, set_final_supply,
set_validator_baseline_reward,
set_validator_baseline_reward, genesis_migrate_cumu_deposits,
},
supply::{populate_supply_stats_from_legacy, SupplySettings},
};
Expand Down Expand Up @@ -157,6 +157,10 @@ pub fn encode_genesis_change_set(
// migrate community wallets
genesis_migrate_community_wallet(&mut session, r)
.expect("could not migrate community wallets");
// cumulative deposits (for match index) also need separate
// migration for CW
genesis_migrate_cumu_deposits(&mut session, r, supply.split_factor)
.expect("could not migrate cumu deposits of cw");
}
}
OLProgress::complete("user migration complete");
Expand Down
4 changes: 2 additions & 2 deletions tools/genesis/tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fn end_to_end_all() {
save_genesis(&tx, &blob).unwrap();
assert!(blob.exists(), "genesis.blob does not exist");

let gen_bytes = fs::read(blob).unwrap();
let gen_bytes = fs::read(&blob).unwrap();

match bcs::from_bytes(&gen_bytes).unwrap() {
Transaction::GenesisTransaction(WriteSetPayload::Direct(recovery_changeset)) => {
Expand All @@ -147,5 +147,5 @@ fn end_to_end_all() {
_ => panic!("not a genesis transaction"),
}

// drop.maybe_cleanup();
if blob.exists() { fs::remove_file(blob).unwrap() }
}

0 comments on commit 7cf645b

Please sign in to comment.