Config for default max gas fee

This commit is contained in:
Łukasz Magiera
2020-10-29 20:50:11 +01:00
parent 7d02cd6679
commit ae7889f830
7 changed files with 62 additions and 9 deletions
+6 -4
View File
@@ -23,6 +23,7 @@ import (
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/store"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/node/modules/dtypes"
)
type GasModuleAPI interface {
@@ -34,9 +35,10 @@ type GasModuleAPI interface {
// Injection (for example with a thin RPC client).
type GasModule struct {
fx.In
Stmgr *stmgr.StateManager
Chain *store.ChainStore
Mpool *messagepool.MessagePool
Stmgr *stmgr.StateManager
Chain *store.ChainStore
Mpool *messagepool.MessagePool
GetMaxFee dtypes.DefaultMaxFeeFunc
}
var _ GasModuleAPI = (*GasModule)(nil)
@@ -291,7 +293,7 @@ func (m *GasModule) GasEstimateMessageGas(ctx context.Context, msg *types.Messag
msg.GasFeeCap = feeCap
}
messagepool.CapGasFee(msg, spec.Get().MaxFee)
messagepool.CapGasFee(m.GetMaxFee, msg, spec.Get().MaxFee)
return msg, nil
}