Skip to content

Commit

Permalink
Merge branch 'todo_beta/params/mint_allocation_proposer' into todo_be…
Browse files Browse the repository at this point in the history
…ta/refactor/mint_allocation_proposer

* todo_beta/params/mint_allocation_proposer:
  test: mint_allocation_proposer validation
  test: mint_allocation_dao validation
  • Loading branch information
bryanchriswhite committed Nov 8, 2024
2 parents 6cc0aea + 71b6abe commit 4987c2c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions x/tokenomics/keeper/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ func TestParams_ValidateMintAllocationDao(t *testing.T) {
mintAllocatioDao: "0",
expectedErr: tokenomicstypes.ErrTokenomicsParamInvalid.Wrap("invalid parameter type: string"),
},
{
desc: "invalid MintAllocationDao (<0)",
mintAllocatioDao: -0.1,
expectedErr: tokenomicstypes.ErrTokenomicsParamInvalid.Wrapf("mint allocation to DAO must be greater than or equal to 0: got %f", -0.1),
},
{
desc: "valid MintAllocationDao",
mintAllocatioDao: tokenomicstypes.DefaultMintAllocationDao,
Expand Down Expand Up @@ -48,6 +53,11 @@ func TestParams_ValidateMintAllocationProposer(t *testing.T) {
mintAllocatioProposer: "0",
expectedErr: tokenomicstypes.ErrTokenomicsParamInvalid.Wrap("invalid parameter type: string"),
},
{
desc: "invalid MintAllocationProposer (<0)",
mintAllocatioProposer: -0.1,
expectedErr: tokenomicstypes.ErrTokenomicsParamInvalid.Wrapf("mint allocation to proposer must be greater than or equal to 0: got %f", -0.1),
},
{
desc: "valid MintAllocationProposer",
mintAllocatioProposer: tokenomicstypes.DefaultMintAllocationProposer,
Expand Down
2 changes: 1 addition & 1 deletion x/tokenomics/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func ValidateMintAllocationProposer(mintAllocationProposer any) error {
}

if mintAllocationProposerFloat < 0 {
return ErrTokenomicsParamInvalid.Wrapf("mint allocation to Proposer must be greater than or equal to 0: got %f", mintAllocationProposerFloat)
return ErrTokenomicsParamInvalid.Wrapf("mint allocation to proposer must be greater than or equal to 0: got %f", mintAllocationProposerFloat)
}

return nil
Expand Down

0 comments on commit 4987c2c

Please sign in to comment.