Skip to content

Commit

Permalink
add keeper checking on ante
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Nov 15, 2024
1 parent eff4230 commit 97c3df0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type HandlerOptions struct {
Codec codec.BinaryCodec
IBCkeeper *ibckeeper.Keeper
OPChildKeeper *opchildkeeper.Keeper
AuctionKeeper auctionkeeper.Keeper
AuctionKeeper *auctionkeeper.Keeper
TxEncoder sdk.TxEncoder
MevLane auctionante.MEVLane
FreeLane block.Lane
Expand All @@ -41,14 +41,21 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, errors.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder")
}

if options.BankKeeper == nil {
return nil, errors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for ante builder")
}

if options.SignModeHandler == nil {
return nil, errors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
}
if options.OPChildKeeper == nil {
return nil, errors.Wrap(sdkerrors.ErrLogic, "opchild keeper is required for ante builder")
}
if options.IBCkeeper == nil {
return nil, errors.Wrap(sdkerrors.ErrLogic, "IBC keeper is required for ante builder")
}
if options.AuctionKeeper == nil {
return nil, errors.Wrap(sdkerrors.ErrLogic, "auction keeper is required for ante builder")
}

sigGasConsumer := options.SigGasConsumer
if sigGasConsumer == nil {
Expand Down Expand Up @@ -92,7 +99,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
sigverify.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCkeeper),
auctionante.NewAuctionDecorator(options.AuctionKeeper, options.TxEncoder, options.MevLane),
auctionante.NewAuctionDecorator(*options.AuctionKeeper, options.TxEncoder, options.MevLane),
opchildante.NewRedundantBridgeDecorator(options.OPChildKeeper),
}

Expand Down
2 changes: 1 addition & 1 deletion app/blocksdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func setupBlockSDK(
Codec: app.appCodec,
OPChildKeeper: app.OPChildKeeper,
TxEncoder: app.txConfig.TxEncoder(),
AuctionKeeper: *app.AuctionKeeper,
AuctionKeeper: app.AuctionKeeper,
MevLane: mevLane,
FreeLane: freeLane,
},
Expand Down

0 comments on commit 97c3df0

Please sign in to comment.