diff --git a/x/protorev/keeper/emit.go b/x/protorev/keeper/emit.go index 2f358da614d..9e84d07f4b0 100644 --- a/x/protorev/keeper/emit.go +++ b/x/protorev/keeper/emit.go @@ -13,7 +13,7 @@ import ( ) // EmitBackrunEvent updates and emits a backrunEvent -func EmitBackrunEvent(ctx sdk.Context, pool SwapToBackrun, inputCoin sdk.Coin, profit, tokenOutAmount sdk.Int, remainingTxPoolPoints, remainingBlockPoolPoints uint64) error { +func EmitBackrunEvent(ctx sdk.Context, pool SwapToBackrun, inputCoin sdk.Coin, profit, tokenOutAmount sdk.Int, remainingTxPoolPoints, remainingBlockPoolPoints uint64) { // Get tx hash txHash := strings.ToUpper(hex.EncodeToString(tmhash.Sum(ctx.TxBytes()))) // Update the backrun event and add it to the context @@ -32,6 +32,4 @@ func EmitBackrunEvent(ctx sdk.Context, pool SwapToBackrun, inputCoin sdk.Coin, p sdk.NewAttribute(types.AttributeKeyProtorevArbDenom, inputCoin.Denom), ) ctx.EventManager().EmitEvent(backrunEvent) - - return nil } diff --git a/x/protorev/keeper/emit_test.go b/x/protorev/keeper/emit_test.go index 0fb51b4ea98..1720fd25a13 100644 --- a/x/protorev/keeper/emit_test.go +++ b/x/protorev/keeper/emit_test.go @@ -52,8 +52,7 @@ func (suite *KeeperTestSuite) TestBackRunEvent() { sdk.NewAttribute(types.AttributeKeyProtorevArbDenom, tc.inputCoin.Denom), ) - err := keeper.EmitBackrunEvent(suite.Ctx, tc.pool, tc.inputCoin, tc.profit, tc.tokenOutAmount, tc.remainingTxPoolPoints, tc.remainingBlockPoolPoints) - suite.Require().NoError(err) + keeper.EmitBackrunEvent(suite.Ctx, tc.pool, tc.inputCoin, tc.profit, tc.tokenOutAmount, tc.remainingTxPoolPoints, tc.remainingBlockPoolPoints) // Get last event emitted and ensure it is the expected event actualEvent := suite.Ctx.EventManager().Events()[len(suite.Ctx.EventManager().Events())-1] diff --git a/x/protorev/keeper/rebalance.go b/x/protorev/keeper/rebalance.go index d18ec857f59..46ad3c44b60 100644 --- a/x/protorev/keeper/rebalance.go +++ b/x/protorev/keeper/rebalance.go @@ -223,10 +223,7 @@ func (k Keeper) ExecuteTrade(ctx sdk.Context, route poolmanagertypes.SwapAmountI } // Create and emit the backrun event and add it to the context - err = EmitBackrunEvent(ctx, pool, inputCoin, profit, tokenOutAmount, remainingTxPoolPoints, remainingBlockPoolPoints) - if err != nil { - return err - } + EmitBackrunEvent(ctx, pool, inputCoin, profit, tokenOutAmount, remainingTxPoolPoints, remainingBlockPoolPoints) return nil }