-
Notifications
You must be signed in to change notification settings - Fork 106
chore(tests): Add BasisModule <> SlippageIssuance Integration Tests #229
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
Conversation
(Closing and re-opening to see if that fixes semantic release bot failure) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should use this to look at scenarios that are more specific to the Basis module. Its moduleIssuance and component hooks are identical with PerpV2LeverageModuleV2 which already runs all these tests.
Might be interesting to remove cases duplicated by the other test file and look at:
- redemption where funding is non-zero
- what happens when calling methods like
withdrawFundingAndAccrueFees
- using
getRedemptionAdjustments
in a redemption flow. - reproducing the revert Iosiro reported when depositing after a withdrawal
- setting the performance fee after withdrawing with different amounts.
I know some of these are annoying to set very specific expectations for but it seems useful to exercise different scenarios and make sure there are no surprises when methods with new logic are called in combination.
@0xSachinK What do you think?
|
I'm thinking of something that models what happens at set-ui... // Displayed
units = slippageIssuanceModule
.callStatic
.getRequiredComponentRedemptionUnitsOffChain(setToken, quantity);
// Real
slippageIssuanceModule.redeem(setToken, quantity)
// Test
Does displayed units match the redeem transaction outcome? Does that make sense? |
7fa3e3e
to
f33678c
Compare
Edited PR description to track all fixes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking really good. I think the only remaining question is about the revert Iosiro triggered when depositing after a withdrawal. They suggested we airdrop into the Set (from Telegram):
WDYT about this and should we consider using Airdrop module or something to manage it?
EDIT - sorry now I see you've addressed this in the audit PR.
// tested in the PerpV2BasisTradingModule unit tests (test/protocol/modules/perpV2BasisTradingModule.spec.ts). And the | ||
// functionality to set external position unit before issuance, has been tested in the PerpV2LeverageModuleV2 <> SlippageIssuanceModule | ||
// integration tests (test/integration/perpV2LeverageV2SlippageIssuance.spec.ts). Hence we will not restest them here. | ||
describe("#issuance", () => {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I guess we could merge here and rebase #232 against it in case additional integration tests would be helpful there.
🎉 This PR is included in version 0.9.0-hhat.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Review suggestions
issuance
tests in 7fa3e3egetRedemptionAdjustment
in a redemption flow to test the UI flow (Added in 9b88be4)Additions to unit tests