feat: add integration tests for ao extra data from scripts repo#1021
feat: add integration tests for ao extra data from scripts repo#1021arwer13 merged 6 commits intofeat/vaultsfrom
Conversation
Hardhat Unit Tests Coverage SummaryDetailsDiff against masterResults for commit: 916e2be Minimum allowed coverage is ♻️ This comment has been updated with latest results |
There was a problem hiding this comment.
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
bigintwhenever possible to avoid unnecessary typecasting. For mathematical operations, we haveBigIntMathavailable.
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.
💭 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.
💭 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.
Any expectations after report? At least check events?
tamtamchik
left a comment
There was a problem hiding this comment.
😕 My bad, tests are green, so this is an approval.
Co-authored-by: Yuri Tkachenko <yuri.tam.tkachenko@gmail.com>
Add integration tests
from https://github.com/lidofinance/scripts/ (also adopted for #978 ).