Skip to content

Commit

Permalink
rebase from migrate-match-index
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Nov 7, 2023
1 parent 55d2aa4 commit e33587d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
Binary file modified framework/releases/head.mrb
Binary file not shown.
46 changes: 24 additions & 22 deletions tools/genesis/src/genesis_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,30 +388,32 @@ pub fn genesis_migrate_community_wallet(
user_recovery: &[LegacyRecovery],
) -> anyhow::Result<()> {
if let Some(root) = user_recovery.iter().find(|e| e.role == AccountRole::System) {
root.comm_wallet
let cw_list = &root
.comm_wallet
.as_ref()
.context("no comm_wallet struct")?
.list
.iter()
.for_each(|el| {
let acc_str = el.to_string();

let new_address = AccountAddress::from_hex_literal(&format!("0x{}", acc_str))
.expect("could not parse address");

let serialized_values = serialize_values(&vec![
MoveValue::Signer(CORE_CODE_ADDRESS),
MoveValue::Signer(new_address),
]);

exec_function(
session,
"community_wallet",
"migrate_community_wallet_account",
vec![],
serialized_values,
);
});
.list;
dbg!("cw list len {}", &cw_list.len());

cw_list.iter().for_each(|el| {
let acc_str = el.to_string();

let new_address = AccountAddress::from_hex_literal(&format!("0x{}", acc_str))
.expect("could not parse address");

let serialized_values = serialize_values(&vec![
MoveValue::Signer(CORE_CODE_ADDRESS),
MoveValue::Signer(new_address),
]);

exec_function(
session,
"community_wallet",
"migrate_community_wallet_account",
vec![],
serialized_values,
);
});
}

Ok(())
Expand Down

0 comments on commit e33587d

Please sign in to comment.