auth: allow 0 coin accounts in genesis (#8714)
* allow zero accounts * fix test * fix test
This commit is contained in:
parent
2139212050
commit
a786830bb4
|
@ -34,11 +34,6 @@ func (b Balance) Validate() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(b.Coins) == 0 {
|
|
||||||
return fmt.Errorf("empty or nil coins for address %s", b.Address)
|
|
||||||
}
|
|
||||||
|
|
||||||
seenDenoms := make(map[string]bool)
|
seenDenoms := make(map[string]bool)
|
||||||
|
|
||||||
// NOTE: we perform a custom validation since the coins.Validate function
|
// NOTE: we perform a custom validation since the coins.Validate function
|
||||||
|
|
|
@ -29,7 +29,7 @@ func TestBalanceValidate(t *testing.T) {
|
||||||
bank.Balance{
|
bank.Balance{
|
||||||
Address: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t",
|
Address: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t",
|
||||||
},
|
},
|
||||||
true,
|
false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"dup coins",
|
"dup coins",
|
||||||
|
|
|
@ -72,7 +72,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||||
true,
|
true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"invalid balance",
|
"0 balance",
|
||||||
GenesisState{
|
GenesisState{
|
||||||
Balances: []Balance{
|
Balances: []Balance{
|
||||||
{
|
{
|
||||||
|
@ -80,7 +80,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
true,
|
false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"dup Metadata",
|
"dup Metadata",
|
||||||
|
|
Loading…
Reference in New Issue