Skip to content

Commit

Permalink
Make a protorev error a constant (#7687)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValarDragon authored Mar 7, 2024
1 parent f1d010c commit c6c2449
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion x/protorev/keeper/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (k Keeper) BuildTwoPoolRoute(
}

if pool1 == pool2 {
return RouteMetaData{}, fmt.Errorf("cannot be trading on the same pool twice")
return RouteMetaData{}, types.ErrRouteDoubleContainsPool
}

newRoute := poolmanagertypes.SwapAmountInRoutes{
Expand Down
2 changes: 2 additions & 0 deletions x/protorev/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ type NoPoolForDenomPairError struct {
func (e NoPoolForDenomPairError) Error() string {
return fmt.Sprintf("highest liquidity pool between base %s and match denom %s not found", e.BaseDenom, e.MatchDenom)
}

var ErrRouteDoubleContainsPool = fmt.Errorf("cannot be trading on the same pool twice")

0 comments on commit c6c2449

Please sign in to comment.