Skip to content

Commit

Permalink
don't initialize megavault subaccount if balance is 0 in genesis (bac…
Browse files Browse the repository at this point in the history
…kport #2464) (#2465)

Co-authored-by: Tian <[email protected]>
  • Loading branch information
mergify[bot] and tqin7 authored Oct 3, 2024
1 parent 4bb0ddb commit 877db14
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 877db14

Please sign in to comment.