Skip to content

Commit

Permalink
Add default params to pool-incentives genesis (#655)
Browse files Browse the repository at this point in the history
* Add default params to pool-incentives genesis

* Change default genState of Records to be nil
  • Loading branch information
mattverse authored Dec 14, 2021
1 parent 97ac2a8 commit 4641e15
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion x/pool-incentives/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ func DefaultGenesisState() *GenesisState {
time.Hour * 3,
time.Hour * 7,
},
DistrInfo: nil,
DistrInfo: &DistrInfo{
TotalWeight: sdk.ZeroInt(),
Records: nil,
},
}
}

Expand Down
15 changes: 12 additions & 3 deletions x/pool-incentives/types/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
},
},
},
}
Expand Down

0 comments on commit 4641e15

Please sign in to comment.