Skip to content

Commit

Permalink
Create mirror accounts for committee members
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Sanchez Quiros committed May 13, 2021
1 parent 0eb9f65 commit 257c2d7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions catalyst-toolbox-lib/src/recovery/tally.rs
Expand Up @@ -284,19 +284,23 @@ impl FragmentReplayer {

for initial in &mut config.initial {
if let Initial::Fund(ref mut utxos) = initial {
let mut new_committee_accounts = Vec::new();
for utxo in utxos.iter_mut() {
let wallet = Wallet::new_account_with_discrimination(
&mut rng,
chain_addr::Discrimination::Production,
);
let new_initial_utxo = wallet.to_initial_fund(utxo.value.into());
wallets.insert(utxo.address.clone(), wallet);
if committee_members.contains(&utxo.address) {
eprintln!("Committee account found {}", &utxo.address);
continue;
// push new mirror address
new_committee_accounts.push(new_initial_utxo);
} else {
*utxo = new_initial_utxo;
}
let new_initial_utxo = wallet.to_initial_fund(utxo.value.into());
wallets.insert(utxo.address.clone(), wallet);
*utxo = new_initial_utxo;
}
utxos.append(&mut new_committee_accounts);
}
}

Expand Down

0 comments on commit 257c2d7

Please sign in to comment.