Conversation
Time Submission Status
You can submit time with the command. Example: See available commands to help comply with our Guidelines. |
📝 WalkthroughWalkthroughThe changes add automatic creation of participant records for Data Providers and Validators in the order book settlement flow, ensuring participants exist before recording net impacts, alongside comprehensive test coverage validating this behavior and correct fee distribution. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/streams/order_book/fee_distribution_test.go (1)
1108-1111: Consider addingob_rewardscleanup verification for consistency.Other tests in this file (e.g., lines 247-249, 447-449, 856-858) verify that
ob_rewardsis cleared after distribution. This test should include the same verification for consistency with the test suite pattern:🔧 Suggested addition before the final return
t.Logf("Audit verified: DP fees=%s, Validator fees=%s", totalDPFeesStr, totalValFeesStr) + // Verify ob_rewards table is cleaned up + rewardsAfter, err := getRewards(ctx, platform, int(marketID), 1000) + require.NoError(t, err) + require.Empty(t, rewardsAfter, "ob_rewards table should be empty after distribution") + return nil } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/streams/order_book/fee_distribution_test.go` around lines 1108 - 1111, Add a final assertion before the function's "return nil" that verifies the ob_rewards state is cleared after distribution: query the ob_rewards entries (e.g., using the same keeper or store access used elsewhere in this file to check ob_rewards) and assert it's empty (use require.Empty / assert.Len == 0 or expect no iterator entries). Place this check just before "return nil" so this test matches the other tests (lines ~247, ~447, ~856) that confirm ob_rewards is cleared after distribution.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/streams/order_book/fee_distribution_test.go`:
- Around line 1108-1111: Add a final assertion before the function's "return
nil" that verifies the ob_rewards state is cleared after distribution: query the
ob_rewards entries (e.g., using the same keeper or store access used elsewhere
in this file to check ob_rewards) and assert it's empty (use require.Empty /
assert.Len == 0 or expect no iterator entries). Place this check just before
"return nil" so this test matches the other tests (lines ~247, ~447, ~856) that
confirm ob_rewards is cleared after distribution.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 119b379e-fbc1-4ff6-84db-aad692cfaba6
📒 Files selected for processing (2)
internal/migrations/033-order-book-settlement.sqltests/streams/order_book/fee_distribution_test.go
resolves: https://github.com/truflation/website/issues/3441
resolves: https://github.com/truflation/website/issues/3419
Data Provider incentives can now be seen on
http://ec2-52-15-66-172.us-east-2.compute.amazonaws.com:8080/v0/prediction-market/participants/0xc11Ff6d3cC60823EcDCAB1089F1A4336053851EF/rewards
It is now recorded in indexer so we Data Provider can view how much they earn
Summary by CodeRabbit
Release Notes