Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaulverin committed Nov 23, 2022
1 parent de4bc7b commit a71fadc
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions router/swap-call-params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ func TestExactInEtherToToken1(t *testing.T) {
})
check(t, "swapExactETHForTokens", swapParams.MethodName)
check(t, hexutil.MustDecodeBig("0x51"), swapParams.Args[0])
check(t, []string{core.WETH9[1].Address.Hex(), token0.Address.Hex(), token1.Address.Hex()}, swapParams.Args[1])
check(t, recipient.Hex(), swapParams.Args[2])
check(t, []common.Address{core.WETH9[1].Address, token0.Address, token1.Address}, swapParams.Args[1])
check(t, recipient, swapParams.Args[2])
check(t, deadline, swapParams.Args[3])
check(t, hexutil.MustDecodeBig("0x64"), swapParams.Value)
}
Expand All @@ -83,8 +83,8 @@ func TestExactInToken1ToEther(t *testing.T) {
check(t, "swapExactTokensForETH", swapParams.MethodName)
check(t, hexutil.MustDecodeBig("0x64"), swapParams.Args[0])
check(t, hexutil.MustDecodeBig("0x51"), swapParams.Args[1])
check(t, []string{token1.Address.Hex(), token0.Address.Hex(), core.WETH9[1].Address.Hex()}, swapParams.Args[2])
check(t, recipient.Hex(), swapParams.Args[3])
check(t, []common.Address{token1.Address, token0.Address, core.WETH9[1].Address}, swapParams.Args[2])
check(t, recipient, swapParams.Args[3])
check(t, deadline, swapParams.Args[4])
check(t, big.NewInt(0), swapParams.Value)
}
Expand All @@ -108,8 +108,8 @@ func TestExactInToken0ToToken1(t *testing.T) {
check(t, "swapExactTokensForTokens", swapParams.MethodName)
check(t, hexutil.MustDecodeBig("0x64"), swapParams.Args[0])
check(t, hexutil.MustDecodeBig("0x59"), swapParams.Args[1])
check(t, []string{token0.Address.Hex(), token1.Address.Hex()}, swapParams.Args[2])
check(t, recipient.Hex(), swapParams.Args[3])
check(t, []common.Address{token0.Address, token1.Address}, swapParams.Args[2])
check(t, recipient, swapParams.Args[3])
check(t, deadline, swapParams.Args[4])
check(t, big.NewInt(0), swapParams.Value)
}
Expand All @@ -132,8 +132,8 @@ func TestExactOutEtherToToken1(t *testing.T) {
})
check(t, "swapETHForExactTokens", swapParams.MethodName)
check(t, hexutil.MustDecodeBig("0x64"), swapParams.Args[0])
check(t, []string{core.WETH9[1].Address.Hex(), token0.Address.Hex(), token1.Address.Hex()}, swapParams.Args[1])
check(t, recipient.Hex(), swapParams.Args[2])
check(t, []common.Address{core.WETH9[1].Address, token0.Address, token1.Address}, swapParams.Args[1])
check(t, recipient, swapParams.Args[2])
check(t, deadline, swapParams.Args[3])
check(t, hexutil.MustDecodeBig("0x80"), swapParams.Value)
}
Expand All @@ -157,8 +157,8 @@ func TestExactOutToken1ToEther(t *testing.T) {
check(t, "swapTokensForExactETH", swapParams.MethodName)
check(t, hexutil.MustDecodeBig("0x64"), swapParams.Args[0])
check(t, hexutil.MustDecodeBig("0x80"), swapParams.Args[1])
check(t, []string{token1.Address.Hex(), token0.Address.Hex(), core.WETH9[1].Address.Hex()}, swapParams.Args[2])
check(t, recipient.Hex(), swapParams.Args[3])
check(t, []common.Address{token1.Address, token0.Address, core.WETH9[1].Address}, swapParams.Args[2])
check(t, recipient, swapParams.Args[3])
check(t, deadline, swapParams.Args[4])
check(t, big.NewInt(0), swapParams.Value)
}
Expand All @@ -182,8 +182,8 @@ func TestExactOutToken0ToToken1(t *testing.T) {
check(t, "swapTokensForExactTokens", swapParams.MethodName)
check(t, hexutil.MustDecodeBig("0x64"), swapParams.Args[0])
check(t, hexutil.MustDecodeBig("0x71"), swapParams.Args[1])
check(t, []string{token0.Address.Hex(), token1.Address.Hex()}, swapParams.Args[2])
check(t, recipient.Hex(), swapParams.Args[3])
check(t, []common.Address{token0.Address, token1.Address}, swapParams.Args[2])
check(t, recipient, swapParams.Args[3])
check(t, deadline, swapParams.Args[4])
check(t, big.NewInt(0), swapParams.Value)
}
Expand All @@ -207,8 +207,8 @@ func TestFeeOnTransferExactInEtherToToken1(t *testing.T) {
})
check(t, "swapExactETHForTokensSupportingFeeOnTransferTokens", swapParams.MethodName)
check(t, hexutil.MustDecodeBig("0x51"), swapParams.Args[0])
check(t, []string{core.WETH9[1].Address.Hex(), token0.Address.Hex(), token1.Address.Hex()}, swapParams.Args[1])
check(t, recipient.Hex(), swapParams.Args[2])
check(t, []common.Address{core.WETH9[1].Address, token0.Address, token1.Address}, swapParams.Args[1])
check(t, recipient, swapParams.Args[2])
check(t, deadline, swapParams.Args[3])
check(t, hexutil.MustDecodeBig("0x64"), swapParams.Value)
}
Expand All @@ -233,8 +233,8 @@ func TestFeeOnTransferExactInToken1ToEther(t *testing.T) {
check(t, "swapExactTokensForETHSupportingFeeOnTransferTokens", swapParams.MethodName)
check(t, hexutil.MustDecodeBig("0x64"), swapParams.Args[0])
check(t, hexutil.MustDecodeBig("0x51"), swapParams.Args[1])
check(t, []string{token1.Address.Hex(), token0.Address.Hex(), core.WETH9[1].Address.Hex()}, swapParams.Args[2])
check(t, recipient.Hex(), swapParams.Args[3])
check(t, []common.Address{token1.Address, token0.Address, core.WETH9[1].Address}, swapParams.Args[2])
check(t, recipient, swapParams.Args[3])
check(t, deadline, swapParams.Args[4])
check(t, big.NewInt(0), swapParams.Value)
}
Expand All @@ -259,8 +259,8 @@ func TestFeeOnTransferExactInToken0ToToken1(t *testing.T) {
check(t, "swapExactTokensForTokensSupportingFeeOnTransferTokens", swapParams.MethodName)
check(t, hexutil.MustDecodeBig("0x64"), swapParams.Args[0])
check(t, hexutil.MustDecodeBig("0x59"), swapParams.Args[1])
check(t, []string{token0.Address.Hex(), token1.Address.Hex()}, swapParams.Args[2])
check(t, recipient.Hex(), swapParams.Args[3])
check(t, []common.Address{token0.Address, token1.Address}, swapParams.Args[2])
check(t, recipient, swapParams.Args[3])
check(t, deadline, swapParams.Args[4])
check(t, big.NewInt(0), swapParams.Value)
}
Expand Down

0 comments on commit a71fadc

Please sign in to comment.