Closed vincentwschau closed 1 week ago
The changes in this pull request focus on modifying the pnl-ticks-helper
module, specifically the getNewPnlTicks
function and its associated tests. The handling of blockHeight
and blockTime
has been streamlined, with these parameters being removed from the function signature and replaced by values derived from the latest block. The test suite has been updated to reflect these changes, ensuring accuracy in the creation of new PnL ticks. Additionally, minor adjustments have been made to the test lifecycle management.
File Path | Change Summary |
---|---|
indexer/services/roundtable/__tests__/helpers/pnl-ticks-helper.test.ts |
Updated tests for getNewPnlTicks to reflect changes in parameters and logic; adjusted setup and teardown processes for better state management. |
indexer/services/roundtable/src/helpers/pnl-ticks-helper.ts |
Modified getPnlTicksCreateObjects to remove blockHeight and blockTime , now fetching values from latestBlock ; updated logging statements. |
indexer/services/roundtable/src/tasks/create-pnl-ticks.ts |
Changed runTask to call getPnlTicksCreateObjects with only txId , simplifying the function's input parameters. |
getNewPnlTicks
function.indexer
, feature:indexer/affiliates
🐰 In the garden where the ticks grow,
A new way to count, as we now know.
With blocks and time, we’ve made it clear,
Creating PnL ticks brings us cheer!
So hop along, let’s test and play,
With every tick, we’ll find our way! 🥕
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Changelist
Fetch the latest block within the same transaction as other PnL tick data to avoid race conditions.
Test Plan
Unit tests.
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.Summary by CodeRabbit
New Features
Bug Fixes
Documentation