Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curve lp tests #293

Merged
merged 3 commits into from
Apr 20, 2022
Merged

Curve lp tests #293

merged 3 commits into from
Apr 20, 2022

Conversation

Paul4912
Copy link
Contributor

No description provided.

@c-n-o-t-e
Copy link
Contributor

Also can you adopt the prettier format.

@@ -792,6 +807,38 @@ describe("IncurDebt", async () => {
.connect(daiHolder)
.createLP(ohmAmount, daiAmount, uniSwapStrategy.address, data);
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you only tested for Should allow borrower create lp for curve can you test for other failed instances like the if statements.

Copy link
Contributor

@c-n-o-t-e c-n-o-t-e Apr 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant testing for these instances

       if (poolTokens[0] == ohmAddress) {
            if (poolTokens[1] != pairTokenAddress) revert CurveStrategy_LPTokenDoesNotMatch();
            if (_ohmAmount != amounts[0]) revert CurveStrategy_AmountsDoNotMatch();
            if (_pairTokenAmount != amounts[1]) revert CurveStrategy_AmountsDoNotMatch();
        } else if (poolTokens[1] == ohmAddress) {
            if (poolTokens[0] != pairTokenAddress) revert CurveStrategy_LPTokenDoesNotMatch();
            if (_ohmAmount != amounts[1]) revert CurveStrategy_AmountsDoNotMatch();
            if (_pairTokenAmount != amounts[0]) revert CurveStrategy_AmountsDoNotMatch();
        } else {
            revert CurveStrategy_LPTokenDoesNotMatch();
        }

@@ -16,10 +16,16 @@ interface ICurvePool {
interface ICurvePoolFactory {
function get_coins(address _pool) external view returns (address[4] memory);

function deploy_plain_pool(string memory _name, string memory _symbol, address[4] memory _coins, uint256 _A, uint256 _fee) external returns (address);
function deploy_plain_pool(
Copy link
Contributor

@c-n-o-t-e c-n-o-t-e Apr 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the functions found in lines 19-29 as they're not used in the contract.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i need them for tests

@Paul4912 Paul4912 force-pushed the curvetests branch 4 times, most recently from 4e3384d to ec0f07c Compare April 20, 2022 06:25
@c-n-o-t-e c-n-o-t-e merged commit a5a51a0 into OlympusDAO:IncurDebt Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants