Skip to content

Commit

Permalink
Fixing uTest
Browse files Browse the repository at this point in the history
  • Loading branch information
pbukva committed Jul 21, 2023
1 parent 7712070 commit 29e0987
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion x/mint/cache/municipal_inflation_cahe.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

type MunicipalInflationCacheItem struct {
PerBlockInflation sdk.Dec
Inflation *types.MunicipalInflation
AnnualInflation *types.MunicipalInflation
}

type MunicipalInflationCache struct {
Expand Down
4 changes: 2 additions & 2 deletions x/mint/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.Q
return &types.QueryParamsResponse{Params: params}, nil
}

// Inflation returns minter.Inflation of the mint module.
// Inflation returns minter.AnnualInflation of the mint module.
func (k Keeper) Inflation(c context.Context, _ *types.QueryInflationRequest) (*types.QueryInflationResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
minter := k.GetMinter(ctx)
Expand All @@ -43,7 +43,7 @@ func (k Keeper) MunicipalInflation(c context.Context, req *types.QueryMunicipalI
return nil, fmt.Errorf("there is no municipal inflation defined for requested \"%s\" denomination", denom)
}

return &types.QueryMunicipalInflationResponse{Inflations: []*types.MunicipalInflationPair{{denom, infl.Inflation}}}, nil
return &types.QueryMunicipalInflationResponse{Inflations: []*types.MunicipalInflationPair{{denom, infl.AnnualInflation}}}, nil
}

// AnnualProvisions returns minter.AnnualProvisions of the mint module.
Expand Down
4 changes: 2 additions & 2 deletions x/mint/types/inflations.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

// NewMunicipalInflation returns a new Inflation object with the given denom, target_address
// NewMunicipalInflation returns a new AnnualInflation object with the given denom, target_address
// and inflation_rate
func NewMunicipalInflation(targetAddress string, inflation sdk.Dec) *MunicipalInflation {
return &MunicipalInflation{
Expand All @@ -28,7 +28,7 @@ func CalculateInflationIssuance(inflation sdk.Dec, supply sdk.Coin) (result sdk.
return sdk.NewCoins(sdk.NewCoin(supply.Denom, issuedAmount))
}

// Validate ensures validity of Inflation object fields
// Validate ensures validity of AnnualInflation object fields

func (inflation *MunicipalInflation) Validate() error {
// NOTE(pb): Algebraically speaking, negative inflation >= -1 is logically
Expand Down
2 changes: 1 addition & 1 deletion x/mint/types/inflations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func TestHandleMunicipalInflation(t *testing.T) {

var testMunicipalInflations = make([]*types.MunicipalInflationPair, len(definedInfations))
for i, infl := range definedInfations {
testMunicipalInflations[i] = &types.MunicipalInflationPair{"denom0", &types.MunicipalInflation{targetAccounts[i].Address.String(), infl.annualInflation}}
testMunicipalInflations[i] = &types.MunicipalInflationPair{infl.denom, &types.MunicipalInflation{targetAccounts[i].Address.String(), infl.annualInflation}}
}

// Configure/initialise Minter with MunicipalInflation:
Expand Down
6 changes: 3 additions & 3 deletions x/mint/types/mint.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x/mint/types/minter.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func DefaultInitialMinter() Minter {
// validate minter
func ValidateMinter(minter Minter) error {
if minter.Inflation.IsNegative() {
return fmt.Errorf("mint parameter Inflation should be positive, is %s",
return fmt.Errorf("mint parameter AnnualInflation should be positive, is %s",
minter.Inflation.String())
}
return nil
Expand Down
16 changes: 8 additions & 8 deletions x/mint/types/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 29e0987

Please sign in to comment.