-
Notifications
You must be signed in to change notification settings - Fork 212
feat: add integration tests for ao extra data from scripts repo #1021
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
base: feat/vaults
Are you sure you want to change the base?
Conversation
Hardhat Unit Tests Coverage Summary
Diff against master
Results for commit: f93adbc Minimum allowed coverage is ♻️ This comment has been updated with latest results |
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.
The current version looks good, and I’m inclined to approve it as is. However, I have a few suggestions:
- We could consider reusing some helper functions from the full-items test in other tests or provisioning by moving them to the protocol context.
- It would be better to use
bigint
whenever possible to avoid unnecessary typecasting. For mathematical operations, we haveBigIntMath
available.
I haven't reviewed everything in detail since the tests are failing on CI.
test/integration/core/accounting-oracle-extra-data-full-items.integration.ts
Outdated
Show resolved
Hide resolved
test/integration/core/accounting-oracle-extra-data-full-items.integration.ts
Outdated
Show resolved
Hide resolved
|
||
after(async () => await Snapshot.restore(snapshot)); | ||
|
||
async function calcNodeOperatorRewards( |
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.
💭 Move to protocol/helpers? Just to not bloat the file and leave only test inside, to make it more readable?
return (mintedShares * BigInt(operatorTotalActiveKeys)) / BigInt(moduleTotalActiveKeys); | ||
} | ||
|
||
async function fillModuleWithOldAndNewOperators( |
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.
💭 looks like we can improve current nor/sdvt protocol helpers and reuse this code for all the modules?
test/integration/core/accounting-oracle-extra-data-full-items.integration.ts
Outdated
Show resolved
Hide resolved
test/integration/core/accounting-oracle-extra-data-full-items.integration.ts
Outdated
Show resolved
Hide resolved
test/integration/core/accounting-oracle-extra-data-full-items.integration.ts
Outdated
Show resolved
Hide resolved
}; | ||
|
||
const { reportTx } = await report(ctx, reportData); | ||
await reportTx?.wait(); |
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.
Any expectations after report? At least check events?
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.
😕 My bad, tests are green, so this is an approval.
Co-authored-by: Yuri Tkachenko <[email protected]>
Add integration tests
from https://github.com/lidofinance/scripts/ (also adopted for #978 ).