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

feat: add repay method #14

Merged
merged 3 commits into from
Sep 21, 2022
Merged

feat: add repay method #14

merged 3 commits into from
Sep 21, 2022

Conversation

sakulstra
Copy link
Collaborator

No description provided.

@@ -201,11 +201,23 @@ contract ProtocolV3TestBase is Test {
IPool pool,
uint256 amount,
bool stable
) internal {
) external {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

made it external as otherwise we cannot try catch it and check specific errors

console.log('BORROW: %s, Amount %s, Stable: %s', config.symbol, amount, stable);
pool.borrow(config.underlying, amount, stable ? 1 : 2, 0, address(this));
}

function _repay(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

wdyt, in most current helpers we require the user to have funds before and provide a flag for approval

I don't see where this is useful as we are not testing the protocol, so having funds and approval could be implicit.

Copy link
Contributor

Choose a reason for hiding this comment

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

yup I fully agree with this. having funds and approved should be defaulted on the method.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, on previous helpers I made, some stuff was clearly useless

@sakulstra sakulstra merged commit e00fd13 into master Sep 21, 2022
@sakulstra sakulstra deleted the feat/repay branch September 21, 2022 15:48
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.

3 participants