Skip to content

Commit

Permalink
rename GlobalMinFee GlobalMinFeeParamSource in FeeDecorator
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaru Wang committed Jun 1, 2023
1 parent f30b78e commit dd17571
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions x/globalfee/ante/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
var _ sdk.AnteDecorator = FeeDecorator{}

type FeeDecorator struct {
GlobalMinFeeSubspace globalfee.ParamSource
StakingSubspace paramtypes.Subspace
GlobalMinFeeParamSource globalfee.ParamSource
StakingSubspace paramtypes.Subspace
}

func NewFeeDecorator(globalfeeSubspace, stakingSubspace paramtypes.Subspace) FeeDecorator {
Expand All @@ -42,8 +42,8 @@ func NewFeeDecorator(globalfeeSubspace, stakingSubspace paramtypes.Subspace) Fee
}

return FeeDecorator{
GlobalMinFeeSubspace: globalfeeSubspace,
StakingSubspace: stakingSubspace,
GlobalMinFeeParamSource: globalfeeSubspace,
StakingSubspace: stakingSubspace,
}
}

Expand Down Expand Up @@ -186,8 +186,8 @@ func (mfd FeeDecorator) GetGlobalFee(ctx sdk.Context, feeTx sdk.FeeTx) (sdk.Coin
err error
)

if mfd.GlobalMinFeeSubspace.Has(ctx, types.ParamStoreKeyMinGasPrices) {
mfd.GlobalMinFeeSubspace.Get(ctx, types.ParamStoreKeyMinGasPrices, &globalMinGasPrices)
if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyMinGasPrices) {
mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyMinGasPrices, &globalMinGasPrices)
}
// global fee is empty set, set global fee to 0uatom
if len(globalMinGasPrices) == 0 {
Expand Down Expand Up @@ -239,16 +239,16 @@ func (mfd FeeDecorator) ContainsOnlyBypassMinFeeMsgs(ctx sdk.Context, msgs []sdk
}

func (mfd FeeDecorator) GetBypassMsgTypes(ctx sdk.Context) (res []string) {
if mfd.GlobalMinFeeSubspace.Has(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes) {
mfd.GlobalMinFeeSubspace.Get(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes, &res)
if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes) {
mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes, &res)
}

return
}

func (mfd FeeDecorator) GetMaxTotalBypassMinFeeMsgGasUsage(ctx sdk.Context) (res uint64) {
if mfd.GlobalMinFeeSubspace.Has(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) {
mfd.GlobalMinFeeSubspace.Get(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &res)
if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) {
mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &res)
}

return
Expand Down

0 comments on commit dd17571

Please sign in to comment.