chore: gofumpt (#11839)
* fumpt using main not master... * be more descriptive * fumpt * fix nits Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
co-authored by
Julien Robert
parent
bc2d553f77
commit
55054282d2
@@ -45,7 +45,6 @@ func GetCmdQueryParams() *cobra.Command {
|
||||
|
||||
params := &types.QueryParamsRequest{}
|
||||
res, err := queryClient.Params(cmd.Context(), params)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -75,7 +74,6 @@ func GetCmdQueryInflation() *cobra.Command {
|
||||
|
||||
params := &types.QueryInflationRequest{}
|
||||
res, err := queryClient.Inflation(cmd.Context(), params)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -105,7 +103,6 @@ func GetCmdQueryAnnualProvisions() *cobra.Command {
|
||||
|
||||
params := &types.QueryAnnualProvisionsRequest{}
|
||||
res, err := queryClient.AnnualProvisions(cmd.Context(), params)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build norace
|
||||
// +build norace
|
||||
|
||||
package testutil
|
||||
|
||||
@@ -34,5 +34,4 @@ func TestParamChangest(t *testing.T) {
|
||||
require.Equal(t, expected[i].simValue, p.SimValue()(r))
|
||||
require.Equal(t, expected[i].subspace, p.Subspace())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,9 +5,7 @@ import (
|
||||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
||||
)
|
||||
|
||||
var (
|
||||
amino = codec.NewLegacyAmino()
|
||||
)
|
||||
var amino = codec.NewLegacyAmino()
|
||||
|
||||
func init() {
|
||||
cryptocodec.RegisterCrypto(amino)
|
||||
|
||||
@@ -25,12 +25,16 @@ func TestNextInflation(t *testing.T) {
|
||||
|
||||
// 100% bonded, starting at 20% inflation and being reduced
|
||||
// (1 - (1/0.67))*(0.13/8667)
|
||||
{sdk.OneDec(), sdk.NewDecWithPrec(20, 2),
|
||||
sdk.OneDec().Sub(sdk.OneDec().Quo(params.GoalBonded)).Mul(params.InflationRateChange).Quo(blocksPerYr)},
|
||||
{
|
||||
sdk.OneDec(), sdk.NewDecWithPrec(20, 2),
|
||||
sdk.OneDec().Sub(sdk.OneDec().Quo(params.GoalBonded)).Mul(params.InflationRateChange).Quo(blocksPerYr),
|
||||
},
|
||||
|
||||
// 50% bonded, starting at 10% inflation and being increased
|
||||
{sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(10, 2),
|
||||
sdk.OneDec().Sub(sdk.NewDecWithPrec(5, 1).Quo(params.GoalBonded)).Mul(params.InflationRateChange).Quo(blocksPerYr)},
|
||||
{
|
||||
sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(10, 2),
|
||||
sdk.OneDec().Sub(sdk.NewDecWithPrec(5, 1).Quo(params.GoalBonded)).Mul(params.InflationRateChange).Quo(blocksPerYr),
|
||||
},
|
||||
|
||||
// test 7% minimum stop (testing with 100% bonded)
|
||||
{sdk.OneDec(), sdk.NewDecWithPrec(7, 2), sdk.ZeroDec()},
|
||||
@@ -115,7 +119,6 @@ func BenchmarkNextInflation(b *testing.B) {
|
||||
for n := 0; n < b.N; n++ {
|
||||
minter.NextInflationRate(params, bondedRatio)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Next annual provisions benchmarking
|
||||
@@ -130,5 +133,4 @@ func BenchmarkNextAnnualProvisions(b *testing.B) {
|
||||
for n := 0; n < b.N; n++ {
|
||||
minter.NextAnnualProvisions(params, totalSupply)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ func ParamKeyTable() paramtypes.KeyTable {
|
||||
func NewParams(
|
||||
mintDenom string, inflationRateChange, inflationMax, inflationMin, goalBonded sdk.Dec, blocksPerYear uint64,
|
||||
) Params {
|
||||
|
||||
return Params{
|
||||
MintDenom: mintDenom,
|
||||
InflationRateChange: inflationRateChange,
|
||||
@@ -80,7 +79,6 @@ func (p Params) Validate() error {
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
}
|
||||
|
||||
// String implements the Stringer interface.
|
||||
|
||||
Reference in New Issue
Block a user