Skip to content

Commit

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

* fix test

* fix test

(cherry picked from commit a786830)

# Conflicts:
#	x/bank/types/genesis_test.go
  • Loading branch information
tac0turtle authored and mergify-bot committed Feb 26, 2021
1 parent ce82077 commit d31fc83
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 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
8 changes: 7 additions & 1 deletion x/bank/types/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,21 @@ func TestGenesisStateValidate(t *testing.T) {
true,
},
{
<<<<<<< HEAD
"invalid balance",
types.GenesisState{
Balances: []types.Balance{
=======
"0 balance",
GenesisState{
Balances: []Balance{
>>>>>>> a786830bb... auth: allow 0 coin accounts in genesis (#8714)
{
Address: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t",
},
},
},
true,
false,
},
{
"dup Metadata",
Expand Down

0 comments on commit d31fc83

Please sign in to comment.