Skip to content

Commit

Permalink
fix(test/e2e): name cannot be empty error (#3706)
Browse files Browse the repository at this point in the history
Recent e2e tests failed with:

```
2024/07/18 17:22:08 Failed to setup testnet: converting accounts into sdk types: invalid account 4: name cannot be empty
```

because #3690 merged.
Since e2e tests aren't run as part of CI on each PR, I didn't learn
about the failure until @ninabarbakadze pinged about it.

## Testing

```
make test-e2e
```

gets past that error locally.
  • Loading branch information
rootulp authored Jul 19, 2024
1 parent 535802c commit acf7fc1
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 @@ -218,6 +218,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 acf7fc1

Please sign in to comment.