Skip to content

Commit

Permalink
Fix genesis state
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 committed Jan 17, 2022
1 parent 24f9a9d commit 11ba488
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions x/gov/types/v1beta2/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ func ValidateGenesis(data *GenesisState) error {
return errors.New("Starting proposal id must be greater than 0")
}

if err := validateTallyParams(data.TallyParams); err != nil {
if err := validateTallyParams(*data.TallyParams); err != nil {
return fmt.Errorf("invalid tally params: %w", err)
}

if err := validateVotingParams(data.VotingParams); err != nil {
if err := validateVotingParams(*data.VotingParams); err != nil {
return fmt.Errorf("invalid voting params: %w", err)
}

if err := validateDepositParams(data.DepositParams); err != nil {
if err := validateDepositParams(*data.DepositParams); err != nil {
return fmt.Errorf("invalid deposit params: %w", err)
}

Expand Down
6 changes: 3 additions & 3 deletions x/gov/types/v1beta2/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (dp DepositParams) Equal(dp2 DepositParams) bool {
}

func validateDepositParams(i interface{}) error {
v, ok := i.(*DepositParams)
v, ok := i.(DepositParams)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}
Expand Down Expand Up @@ -95,7 +95,7 @@ func (tp TallyParams) Equal(other TallyParams) bool {
}

func validateTallyParams(i interface{}) error {
v, ok := i.(*TallyParams)
v, ok := i.(TallyParams)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}
Expand Down Expand Up @@ -154,7 +154,7 @@ func (vp VotingParams) Equal(other VotingParams) bool {
}

func validateVotingParams(i interface{}) error {
v, ok := i.(*VotingParams)
v, ok := i.(VotingParams)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}
Expand Down

0 comments on commit 11ba488

Please sign in to comment.