package arbitrage import ( "math/big" "testing" "github.com/fraktal/mev-beta/pkg/math" ) func TestEthAmountStringPrefersDecimalSnapshot(t *testing.T) { ud, err := math.NewUniversalDecimal(big.NewInt(1500000000000000000), 18, "ETH") if err != nil { t.Fatalf("unexpected error creating decimal: %v", err) } got := ethAmountString(nil, ud, nil) if got != "1.500000" { t.Fatalf("expected 1.500000, got %s", got) } } func TestEthAmountStringFallsBackToWei(t *testing.T) { wei := big.NewInt(123450000000000000) got := ethAmountString(nil, nil, wei) if got != "0.123450" { t.Fatalf("expected 0.123450, got %s", got) } } func TestGweiAmountStringFormatsTwoDecimals(t *testing.T) { wei := big.NewInt(987654321) got := gweiAmountString(nil, nil, wei) if got != "0.99" { t.Fatalf("expected 0.99, got %s", got) } }