Skip to content

Commit f778514

Browse files
committed
fix lint
1 parent c634e42 commit f778514

File tree

6 files changed

+2
-40
lines changed

6 files changed

+2
-40
lines changed

pkg/finderengine/entity/route.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ type Route struct {
1919
}
2020

2121
func NewConstructRoute(tokenIn, tokenOut string) *Route {
22-
2322
return &Route{
24-
TokenIn: tokenIn,
25-
TokenOut: tokenOut,
26-
23+
TokenIn: tokenIn,
24+
TokenOut: tokenOut,
2725
AmountIn: big.NewInt(0),
2826
AmountOut: big.NewInt(0),
2927
Paths: []*Path{},

pkg/finderengine/findpath.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ func (f *Finder) findBestPathsOptimized(
1414
minHops map[string]uint64,
1515
edges map[string]map[string][]dexlibPool.IPoolSimulator,
1616
) []*entity.Path {
17-
1817
startNode := entity.NewPath(params.AmountIn)
1918
layer := map[string][]*entity.Path{
2019
params.TokenIn: {startNode},

pkg/finderengine/gen_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
)
1111

1212
func GenTest() (map[string]entity.SimplifiedToken, map[string]struct{}, map[string]map[string][]dexlibPool.IPoolSimulator) {
13-
1413
tokens := make(map[string]entity.SimplifiedToken)
1514
for i := 0; i < 1000; i++ {
1615
addr := fmt.Sprintf("token%d", i)
@@ -35,7 +34,6 @@ func GenTest() (map[string]entity.SimplifiedToken, map[string]struct{}, map[stri
3534
}
3635

3736
func BenchmarkFindBestPathsOptimized(b *testing.B) {
38-
// setup above: tokens, edges, params...
3937
tokens, whitelist, edges := GenTest()
4038
params := &entity.FinderParams{
4139
TokenIn: "token0",

pkg/finderengine/hop_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package finderengine
22

33
import (
4-
"fmt"
54
"math/big"
65
"testing"
76

@@ -51,7 +50,6 @@ func (mp *mockPool) GetTokens() []string { return []string{mp.tokenIn, mp.to
5150
func (mp *mockPool) GetReserves() []*big.Int { return nil }
5251
func (mp *mockPool) GetAddress() string { return mp.address }
5352
func (mp *mockPool) GetExchange() string {
54-
fmt.Println(mp.rate.String())
5553
return ""
5654
}
5755
func (mp *mockPool) GetType() string { return "" }
@@ -69,12 +67,6 @@ func Test_FindHops(t *testing.T) {
6967
amountIn := big.NewInt(1000000)
7068
numSplits := uint64(6)
7169
hop := FindHops("A", 1, 18, "B", amountIn, pools, numSplits)
72-
73-
fmt.Println("Split result:")
74-
for _, split := range hop.Splits {
75-
fmt.Printf("Pool: %s, AmountIn: %s, AmountOut: %s\n", split.ID, split.AmountIn.String(), split.AmountOut.String())
76-
}
77-
7870
// Assert each pool got used
7971
assert.Len(t, hop.Splits, 2)
8072
}

pkg/finderengine/utils.go

Lines changed: 0 additions & 23 deletions
This file was deleted.

pkg/finderengine/utils/utils.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ func CalcAmountPrice(amount *big.Int, decimals uint8, price float64) float64 {
1010
return amountFloat * price / math.Pow10(int(decimals))
1111
}
1212

13-
// CalcAmountUSD returns amount in from usd amount
14-
// amount = (amountUSD / price) * 10^decimals
1513
func CalcAmountFromPrice(amountUSD float64, decimals uint8, price float64) *big.Int {
1614
amountUSDBI := new(big.Float).SetFloat64(amountUSD)
1715
priceUSDBI := new(big.Float).SetFloat64(price)

0 commit comments

Comments
 (0)