Skip to content

Commit

Permalink
BE-661 | Fix: claimbot panics (#597) (#598)
Browse files Browse the repository at this point in the history
Fixes claimbot panics due nil routerrepo.RouterRepository in txGasCalulator

(cherry picked from commit 8cb0091)

Co-authored-by: Deividas Petraitis <hi@deividaspetraitis.lt>
  • Loading branch information
mergify[bot] and deividaspetraitis authored Dec 6, 2024
1 parent 1aac3c9 commit 3b5880f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Changelog

Unreleased

- Fixed claimbot panics due nil routerrepo.RouterRepository in txGasCalulator

## v27.2.0

- #593 - Add denoms filter for /pools endpoint
Expand Down
1 change: 1 addition & 0 deletions app/sidecar_query_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ func NewSideCarQueryServer(appCodec codec.Codec, config domain.Config, logger lo
keyring,
orderBookUseCase,
poolsUseCase,
gasCalculator,
logger,
config.ChainGRPCGatewayEndpoint,
config.ChainID,
Expand Down
3 changes: 2 additions & 1 deletion ingest/usecase/plugins/orderbook/claimbot/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func NewConfig(
keyring keyring.Keyring,
orderbookusecase mvc.OrderBookUsecase,
poolsUseCase mvc.PoolsUsecase,
msgSimulator sqstx.MsgSimulator,
logger log.Logger,
chainGRPCGatewayEndpoint string,
chainID string,
Expand All @@ -45,7 +46,7 @@ func NewConfig(
PoolsUseCase: poolsUseCase,
OrderbookUsecase: orderbookusecase,
AccountQueryClient: authtypes.NewQueryClient(grpcClient),
MsgSimulator: sqstx.NewMsgSimulator(grpcClient, sqstx.CalculateGas, nil),
MsgSimulator: msgSimulator,
TxServiceClient: txtypes.NewServiceClient(grpcClient),
Logger: logger.Named("claimbot"),
ChainID: chainID,
Expand Down
4 changes: 3 additions & 1 deletion ingest/usecase/plugins/orderbook/claimbot/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"sync/atomic"

"github.com/osmosis-labs/sqs/domain"
"github.com/osmosis-labs/sqs/domain/cosmos/tx"
"github.com/osmosis-labs/sqs/domain/keyring"
"github.com/osmosis-labs/sqs/domain/mvc"
orderbookdomain "github.com/osmosis-labs/sqs/domain/orderbook"
Expand Down Expand Up @@ -47,11 +48,12 @@ func New(
keyring keyring.Keyring,
orderbookusecase mvc.OrderBookUsecase,
poolsUsecase mvc.PoolsUsecase,
msgSimulator tx.MsgSimulator,
logger log.Logger,
chainGRPCGatewayEndpoint string,
chainID string,
) (*claimbot, error) {
config, err := NewConfig(keyring, orderbookusecase, poolsUsecase, logger, chainGRPCGatewayEndpoint, chainID)
config, err := NewConfig(keyring, orderbookusecase, poolsUsecase, msgSimulator, logger, chainGRPCGatewayEndpoint, chainID)
if err != nil {
return nil, fmt.Errorf("failed to create config: %w", err)
}
Expand Down

0 comments on commit 3b5880f

Please sign in to comment.