This commit is contained in:
pradyuman-verma 2021-12-15 00:54:54 +05:30
parent 3b4e272090
commit 2a0a61f1e1
2 changed files with 19 additions and 9 deletions

View File

@ -35,7 +35,7 @@ abstract contract SushipswapIncentiveResolver is Helpers, Events {
token1 = changeEthAddrToWethAddr(token1);
token2 = changeEthAddrToWethAddr(token2);
amount = getUint(getId, amount);
if(data.poolId == uint256(-1)|| data.version < 0 || data.lpToken == address(0)){
if(data.poolId == uint256(-1)|| data.version <= 0 || data.lpToken == address(0)){
data = _getPoolId(
token1,
token2
@ -74,7 +74,7 @@ abstract contract SushipswapIncentiveResolver is Helpers, Events {
token1 = changeEthAddrToWethAddr(token1);
token2 = changeEthAddrToWethAddr(token2);
amount = getUint(getId, amount);
if(data.poolId == uint256(-1)|| data.version < 0){
if(data.poolId == uint256(-1)|| data.version <= 0){
data = _getPoolId(
token1,
token2
@ -106,7 +106,7 @@ abstract contract SushipswapIncentiveResolver is Helpers, Events {
{
token1 = changeEthAddrToWethAddr(token1);
token2 = changeEthAddrToWethAddr(token2);
if(data.poolId == uint256(-1)|| data.version < 0 ){
if(data.poolId == uint256(-1)|| data.version <= 0 ){
data = _getPoolId(
token1,
token2
@ -145,7 +145,7 @@ abstract contract SushipswapIncentiveResolver is Helpers, Events {
token1 = changeEthAddrToWethAddr(token1);
token2 = changeEthAddrToWethAddr(token2);
amount = getUint(getId, amount);
if(data.poolId == uint256(-1)|| data.version < 0){
if(data.poolId == uint256(-1)|| data.version <= 0){
data = _getPoolId(
token1,
token2
@ -178,7 +178,7 @@ abstract contract SushipswapIncentiveResolver is Helpers, Events {
{
token1 = changeEthAddrToWethAddr(token1);
token2 = changeEthAddrToWethAddr(token2);
if(data.poolId == uint256(-1)|| data.version < 0 ){
if(data.poolId == uint256(-1)|| data.version <= 0 ){
data = _getPoolId(
token1,
token2

View File

@ -94,6 +94,12 @@ describe("Sushiswap", function () {
});
describe("Main", function () {
const data = {
poolId: 0,
version: 0,
lpToken: ethers.constants.AddressZero
}
it("Should deposit successfully", async function () {
const ethAmount = ethers.utils.parseEther("2") // 1 ETH
const daiUnitAmount = ethers.utils.parseEther("4000") // 1 ETH
@ -134,7 +140,8 @@ describe("Sushiswap", function () {
DAI_ADDR,
ethers.utils.parseEther("10"),
getId,
setId
setId,
data
]
}
]
@ -152,7 +159,8 @@ describe("Sushiswap", function () {
args: [
WETH_ADDR,
DAI_ADDR,
setId
setId,
data
]
}
]
@ -173,7 +181,8 @@ describe("Sushiswap", function () {
DAI_ADDR,
ethers.utils.parseEther("1"),
getId,
setId
setId,
data
]
}
]
@ -194,7 +203,8 @@ describe("Sushiswap", function () {
DAI_ADDR,
ethers.utils.parseEther("1"),
getId,
setId
setId,
data
]
}
]