diff --git a/x/claim/types/genesis.go b/x/claim/types/genesis.go index 750e0a3..387cfb1 100644 --- a/x/claim/types/genesis.go +++ b/x/claim/types/genesis.go @@ -5,6 +5,7 @@ import ( "fmt" sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) const DefaultIndex uint64 = 1 @@ -12,10 +13,10 @@ const DefaultIndex uint64 = 1 // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ + AirdropSupply: AirdropSupply{Supply: sdk.NewCoin("utest", sdkmath.ZeroInt())}, ClaimRecordList: []ClaimRecord{}, MissionList: []Mission{}, InitialClaim: InitialClaim{}, - AirdropSupply: AirdropSupply{}, // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } diff --git a/x/claim/types/genesis_test.go b/x/claim/types/genesis_test.go index 5b92dfa..7b41f49 100644 --- a/x/claim/types/genesis_test.go +++ b/x/claim/types/genesis_test.go @@ -56,6 +56,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: fiftyPercent, }, }, + MissionCount: 2, AirdropSupply: types.AirdropSupply{Supply: sdk.NewCoin("foo", claimAmts[0].Add(claimAmts[1]))}, InitialClaim: types.InitialClaim{ Enabled: false, @@ -75,6 +76,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: sdkmath.LegacyOneDec(), }, }, + MissionCount: 1, AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "0foo")}, }, valid: true, @@ -121,6 +123,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: sdkmath.LegacyZeroDec(), }, }, + MissionCount: 2, AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, }, valid: true, @@ -151,6 +154,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: tc.Dec(t, "0.6"), }, }, + MissionCount: 2, AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "10foo")}, }, valid: true, @@ -181,6 +185,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: tc.Dec(t, "0.6"), }, }, + MissionCount: 2, AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "6foo")}, }, valid: true, @@ -211,6 +216,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: sdkmath.LegacyZeroDec(), }, }, + MissionCount: 2, AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, }, valid: true, @@ -235,6 +241,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: sdkmath.LegacyOneDec(), }, }, + MissionCount: 1, AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, InitialClaim: types.InitialClaim{ Enabled: true, @@ -263,6 +270,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: sdkmath.LegacyOneDec(), }, }, + MissionCount: 1, AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, }, valid: false, @@ -287,6 +295,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: sdkmath.LegacyOneDec(), }, }, + MissionCount: 1, AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, }, valid: false, @@ -312,6 +321,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: sdkmath.LegacyOneDec(), }, }, + MissionCount: 1, }, valid: false, }, @@ -336,6 +346,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: sdkmath.LegacyOneDec(), }, }, + MissionCount: 1, }, valid: false, }, @@ -364,6 +375,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: tc.Dec(t, "0.6"), }, }, + MissionCount: 2, AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, }, valid: false, @@ -389,6 +401,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: sdkmath.LegacyOneDec(), }, }, + MissionCount: 1, AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, }, valid: false, @@ -404,6 +417,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: sdkmath.LegacyOneDec(), }, }, + MissionCount: 1, }, valid: false, }, @@ -421,6 +435,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: fiftyPercent, }, }, + MissionCount: 2, }, valid: false, }, @@ -438,6 +453,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: sdkmath.LegacyZeroDec(), }, }, + MissionCount: 2, }, valid: false, }, @@ -477,6 +493,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: sdkmath.LegacyOneDec(), }, }, + MissionCount: 1, AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "0foo")}, }, valid: false,