Skip to content

Commit

Permalink
test: mint_allocation_proposer validation
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed Nov 8, 2024
1 parent 30a66dc commit 71b6abe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions x/tokenomics/keeper/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,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 71b6abe

Please sign in to comment.