Skip to content

Commit

Permalink
auth: allow 0 coin accounts in genesis (cosmos#8714)
Browse files Browse the repository at this point in the history
* allow zero accounts

* fix test

* fix test
  • Loading branch information
tac0turtle authored Feb 26, 2021
1 parent 2139212 commit a786830
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
5 changes: 0 additions & 5 deletions x/bank/types/balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ func (b Balance) Validate() error {
if err != nil {
return err
}

if len(b.Coins) == 0 {
return fmt.Errorf("empty or nil coins for address %s", b.Address)
}

seenDenoms := make(map[string]bool)

// NOTE: we perform a custom validation since the coins.Validate function
Expand Down
2 changes: 1 addition & 1 deletion x/bank/types/balance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestBalanceValidate(t *testing.T) {
bank.Balance{
Address: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t",
},
true,
false,
},
{
"dup coins",
Expand Down
4 changes: 2 additions & 2 deletions x/bank/types/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ func TestGenesisStateValidate(t *testing.T) {
true,
},
{
"invalid balance",
"0 balance",
GenesisState{
Balances: []Balance{
{
Address: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t",
},
},
},
true,
false,
},
{
"dup Metadata",
Expand Down

0 comments on commit a786830

Please sign in to comment.