package parsers import ( "context" "math/big" "github.com/ethereum/go-ethereum/common" "coppertone.tech/fraktal/mev-bot/pkg/observability" ) // mockLogger implements a simple logger for testing type mockLogger struct{} func (m *mockLogger) Debug(msg string, args ...any) {} func (m *mockLogger) Info(msg string, args ...any) {} func (m *mockLogger) Warn(msg string, args ...any) {} func (m *mockLogger) Error(msg string, args ...any) {} func (m *mockLogger) With(args ...any) observability.Logger { return m } func (m *mockLogger) WithContext(ctx context.Context) observability.Logger { return m } // encodeSwapData encodes UniswapV2 swap data in ABI format for testing func encodeSwapData(amount0In, amount1In, amount0Out, amount1Out *big.Int) []byte { // Each uint256 is 32 bytes data := make([]byte, 128) // 4 * 32 bytes // amount0In copy(data[0:32], common.LeftPadBytes(amount0In.Bytes(), 32)) // amount1In copy(data[32:64], common.LeftPadBytes(amount1In.Bytes(), 32)) // amount0Out copy(data[64:96], common.LeftPadBytes(amount0Out.Bytes(), 32)) // amount1Out copy(data[96:128], common.LeftPadBytes(amount1Out.Bytes(), 32)) return data }