Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Sep 19, 2024
1 parent 105bfdf commit aa94f02
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions x/validate/depinject.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package validate

import (
"errors"
"fmt"

modulev1 "cosmossdk.io/api/cosmos/validate/module/v1"
Expand Down Expand Up @@ -38,9 +37,9 @@ type ModuleInputs struct {
TxConfig client.TxConfig
DynamicConfig server.DynamicConfig `optional:"true"`

AccountKeeper ante.AccountKeeper
BankKeeper authtypes.BankKeeper
ConsensusKeeper ante.ConsensusKeeper
BankKeeper authtypes.BankKeeper `optional:"true"`
AccountKeeper ante.AccountKeeper `optional:"true"`
FeeGrantKeeper ante.FeegrantKeeper `optional:"true"`
AccountAbstractionKeeper ante.AccountAbstractionKeeper `optional:"true"`
ExtraTxValidators []appmodulev2.TxValidator[transaction.Tx] `optional:"true"`
Expand All @@ -60,7 +59,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs {
in.AccountKeeper,
in.TxConfig.SignModeHandler(),
ante.DefaultSigVerificationGasConsumer,
in.AccountAbstractionKeeper,
in.AccountAbstractionKeeper, // can be nil
)

var (
Expand All @@ -69,7 +68,8 @@ func ProvideModule(in ModuleInputs) ModuleOutputs {
feeTxValidator *ante.DeductFeeDecorator
unorderedTxValidator *ante.UnorderedTxDecorator
)
if in.AccountKeeper != nil && in.BankKeeper != nil && in.DynamicConfig != nil {

if in.DynamicConfig != nil {
minGasPricesStr := in.DynamicConfig.GetString(flagMinGasPricesV2)
minGasPrices, err = sdk.ParseDecCoins(minGasPricesStr)
if err != nil {
Expand Down Expand Up @@ -125,10 +125,6 @@ func newBaseAppOption(in ModuleInputs) func(app *baseapp.BaseApp) {
}

func newAnteHandler(in ModuleInputs) (sdk.AnteHandler, error) {
if in.BankKeeper == nil {
return nil, errors.New("both AccountKeeper and BankKeeper are required")
}

anteHandler, err := ante.NewAnteHandler(
ante.HandlerOptions{
Environment: in.Environment,
Expand Down

0 comments on commit aa94f02

Please sign in to comment.