33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package mocks
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
// TestMockDEXInteraction tests mock DEX interaction creation
|
|
func TestMockDEXInteraction(t *testing.T) {
|
|
dexInteraction := CreateMockDEXInteraction()
|
|
|
|
assert.Equal(t, "UniswapV3", dexInteraction.Protocol)
|
|
assert.Equal(t, common.HexToAddress("0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640"), dexInteraction.Pool)
|
|
assert.Equal(t, common.HexToAddress("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"), dexInteraction.TokenIn)
|
|
assert.Equal(t, common.HexToAddress("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"), dexInteraction.TokenOut)
|
|
assert.NotNil(t, dexInteraction.AmountIn)
|
|
assert.NotNil(t, dexInteraction.AmountOut)
|
|
}
|
|
|
|
// TestMockTransaction tests mock transaction creation
|
|
func TestMockTransaction(t *testing.T) {
|
|
to := common.HexToAddress("0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640")
|
|
data := []byte("test_data")
|
|
|
|
tx := CreateMockTransaction(to, data)
|
|
|
|
assert.Equal(t, to, *tx.To())
|
|
assert.Equal(t, data, tx.Data())
|
|
assert.Equal(t, uint64(1), tx.Nonce())
|
|
}
|