Skip to content

Commit

Permalink
Merge branch 'master' into faddat/lint
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed May 24, 2023
2 parents d683d37 + a354fe4 commit 033a133
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cmd/akash/cmd/genaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,17 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
return errors.Errorf("failed to get accounts from any: %v", err)
}

if accs.Contains(addr) {
return errors.Errorf("cannot add account at existing address %s", addr)
lAccountNumber := uint64(0)
if len(accs) > 0 {
if accs.Contains(addr) {
return errors.Errorf("cannot add account at existing address %s", addr)
}
accs = authtypes.SanitizeGenesisAccounts(accs)
lAccountNumber = accs[len(accs)-1].GetAccountNumber() + 1
}

accs = authtypes.SanitizeGenesisAccounts(accs)
lAccountNumber := accs[len(accs)-1].GetAccountNumber()
// sdk always returns nil
_ = genAccount.SetAccountNumber(lAccountNumber + 1)
_ = genAccount.SetAccountNumber(lAccountNumber)

accs = append(accs, genAccount)

Expand Down

0 comments on commit 033a133

Please sign in to comment.