Skip to content

Commit

Permalink
fix(test/e2e): name cannot be empty error (backport #3706) (#3714)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jul 19, 2024
1 parent 35cad92 commit 37eea7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/e2e/testnet/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ func (t *Testnet) CreateAccount(name string, tokens int64, txsimKeyringDir strin
err = t.genesis.AddAccount(genesis.Account{
PubKey: pk,
Balance: tokens,
Name: name,
})
if err != nil {
return nil, err
Expand Down
3 changes: 3 additions & 0 deletions test/util/genesis/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ func (g *Genesis) WithKeyringAccounts(accs ...KeyringAccount) *Genesis {

// AddAccount adds an existing account to the genesis.
func (g *Genesis) AddAccount(account Account) error {
if err := account.ValidateBasic(); err != nil {
return err
}
for _, acc := range g.accounts {
if bytes.Equal(acc.PubKey.Bytes(), account.PubKey.Bytes()) {
return fmt.Errorf("account with pubkey %s already exists", account.PubKey.String())
Expand Down

0 comments on commit 37eea7f

Please sign in to comment.