Skip to content

Commit

Permalink
don't initialize megavault subaccount if balance is 0 in genesis (#2464)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqin7 authored Oct 3, 2024
1 parent 64fa696 commit 537bf4a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions protocol/testing/genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1827,9 +1827,11 @@ function edit_genesis() {
acct_idx=$(($acct_idx + 1))
done
# Update subaccounts module for megavault main vault account.
add_subaccount "$GENESIS" "$acct_idx" "$MEGAVAULT_MAIN_VAULT_ACCOUNT_ADDR" "$DEFAULT_MEGAVAULT_MAIN_VAULT_QUOTE_BALANCE"
total_accounts_quote_balance=$(($total_accounts_quote_balance + $DEFAULT_MEGAVAULT_MAIN_VAULT_QUOTE_BALANCE))
acct_idx=$(($acct_idx + 1))
if [ "$DEFAULT_MEGAVAULT_MAIN_VAULT_QUOTE_BALANCE" -gt 0 ]; then
add_subaccount "$GENESIS" "$acct_idx" "$MEGAVAULT_MAIN_VAULT_ACCOUNT_ADDR" "$DEFAULT_MEGAVAULT_MAIN_VAULT_QUOTE_BALANCE"
total_accounts_quote_balance=$(($total_accounts_quote_balance + $DEFAULT_MEGAVAULT_MAIN_VAULT_QUOTE_BALANCE))
acct_idx=$(($acct_idx + 1))
fi

next_bank_idx=0
if (( total_accounts_quote_balance > 0 )); then
Expand Down

0 comments on commit 537bf4a

Please sign in to comment.