small code refactor

This commit is contained in:
Samyak Jain 2019-06-24 02:57:30 +05:30
parent 39cbd004e8
commit 12ffa7dfcb

View File

@ -370,6 +370,26 @@ contract GetDetails is MakerHelpers {
);
}
function getLeverage(
uint cdpID,
uint daiToSwap
) public view returns (
uint finalEthCol,
uint finalDaiDebt,
uint finalColToUSD,
bool canLeverage
)
{
bytes32 cup = bytes32(cdpID);
(uint ethCol, uint daiDebt, uint usdPerEth) = getCDPStats(cup);
(finalEthCol, finalDaiDebt, finalColToUSD, canLeverage) = checkLeverage(
ethCol,
daiDebt,
usdPerEth,
daiToSwap
);
}
/**
* @param isBest 0 is ETH2DAI, 1 is Kyber
*/
@ -392,26 +412,6 @@ contract GetDetails is MakerHelpers {
}
}
function getLeverage(
uint cdpID,
uint daiToSwap
) public view returns (
uint finalEthCol,
uint finalDaiDebt,
uint finalColToUSD,
bool canLeverage
)
{
bytes32 cup = bytes32(cdpID);
(uint ethCol, uint daiDebt, uint usdPerEth) = getCDPStats(cup);
(finalEthCol, finalDaiDebt, finalColToUSD, canLeverage) = checkLeverage(
ethCol,
daiDebt,
usdPerEth,
daiToSwap
);
}
function checkSave(
uint ethCol,
uint daiDebt,