From 4641e151b7e14931ba085863ea94157ce74421c8 Mon Sep 17 00:00:00 2001 From: "Matt, Park" <45252226+mattverse@users.noreply.github.com> Date: Tue, 14 Dec 2021 21:24:36 +0900 Subject: [PATCH] Add default params to pool-incentives genesis (#655) * Add default params to pool-incentives genesis * Change default genState of Records to be nil --- x/pool-incentives/types/genesis.go | 5 ++++- x/pool-incentives/types/genesis_test.go | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/x/pool-incentives/types/genesis.go b/x/pool-incentives/types/genesis.go index b9977090494..fdaefeadd63 100644 --- a/x/pool-incentives/types/genesis.go +++ b/x/pool-incentives/types/genesis.go @@ -27,7 +27,10 @@ func DefaultGenesisState() *GenesisState { time.Hour * 3, time.Hour * 7, }, - DistrInfo: nil, + DistrInfo: &DistrInfo{ + TotalWeight: sdk.ZeroInt(), + Records: nil, + }, } } diff --git a/x/pool-incentives/types/genesis_test.go b/x/pool-incentives/types/genesis_test.go index 8d38d4cc4da..25c84ba8468 100644 --- a/x/pool-incentives/types/genesis_test.go +++ b/x/pool-incentives/types/genesis_test.go @@ -22,14 +22,20 @@ func TestGenesisStateMarshalUnmarshal(t *testing.T) { state: &types.GenesisState{ Params: types.DefaultParams(), LockableDurations: []time.Duration(nil), - DistrInfo: nil, + DistrInfo: &types.DistrInfo{ + TotalWeight: sdk.ZeroInt(), + Records: nil, + }, }, }, { // empty array distribution info state: &types.GenesisState{ Params: types.DefaultParams(), LockableDurations: []time.Duration(nil), - DistrInfo: &types.DistrInfo{}, + DistrInfo: &types.DistrInfo{ + TotalWeight: sdk.ZeroInt(), + Records: nil, + }, }, }, { // one record distribution info @@ -51,7 +57,10 @@ func TestGenesisStateMarshalUnmarshal(t *testing.T) { state: &types.GenesisState{ Params: types.Params{}, LockableDurations: []time.Duration(nil), - DistrInfo: nil, + DistrInfo: &types.DistrInfo{ + TotalWeight: sdk.ZeroInt(), + Records: nil, + }, }, }, }