diff --git a/CHANGELOG.md b/CHANGELOG.md index f046a1e2..f2c052b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/app/sidecar_query_server.go b/app/sidecar_query_server.go index 3a364f64..f966da52 100644 --- a/app/sidecar_query_server.go +++ b/app/sidecar_query_server.go @@ -317,6 +317,7 @@ func NewSideCarQueryServer(appCodec codec.Codec, config domain.Config, logger lo keyring, orderBookUseCase, poolsUseCase, + gasCalculator, logger, config.ChainGRPCGatewayEndpoint, config.ChainID, diff --git a/ingest/usecase/plugins/orderbook/claimbot/config.go b/ingest/usecase/plugins/orderbook/claimbot/config.go index e8a9fa24..f01f0343 100644 --- a/ingest/usecase/plugins/orderbook/claimbot/config.go +++ b/ingest/usecase/plugins/orderbook/claimbot/config.go @@ -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, @@ -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, diff --git a/ingest/usecase/plugins/orderbook/claimbot/plugin.go b/ingest/usecase/plugins/orderbook/claimbot/plugin.go index 581b5ee6..1aadaec4 100644 --- a/ingest/usecase/plugins/orderbook/claimbot/plugin.go +++ b/ingest/usecase/plugins/orderbook/claimbot/plugin.go @@ -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" @@ -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) }