Skip to content

test: adjust rewards related test to give provider earning#1326

Merged
MicBun merged 1 commit intomainfrom
testDataProv
Mar 5, 2026
Merged

test: adjust rewards related test to give provider earning#1326
MicBun merged 1 commit intomainfrom
testDataProv

Conversation

@MicBun
Copy link
Member

@MicBun MicBun commented Mar 5, 2026

resolves: https://github.com/truflation/website/issues/3419

Summary by CodeRabbit

  • Tests
    • Enhanced test coverage for order book and settlement operations with improved assertion validation and test isolation.

@MicBun MicBun requested a review from pr-time-tracker March 5, 2026 05:29
@MicBun MicBun self-assigned this Mar 5, 2026
@holdex
Copy link

holdex bot commented Mar 5, 2026

Time Submission Status

Member Status Time Action Last Update
MicBun ✅ Submitted 3h 30min Update time Mar 5, 2026, 3:58 PM

You can submit time with the command. Example:

@holdex pr submit-time 15m

See available commands to help comply with our Guidelines.

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

📝 Walkthrough

Walkthrough

This PR enhances test coverage and refactors test infrastructure: it adds a specific error message assertion for malformed ABI detection in one test, and refactors another test to isolate data-provider operations using a dedicated engine context throughout the settlement workflow.

Changes

Cohort / File(s) Summary
Error Assertion Enhancement
tests/streams/order_book/create_market_with_components_test.go
Added assertion to verify error message contains "length insufficient" substring for malformed ABI validation.
Data Provider Context Refactoring
tests/streams/order_book/settlement_payout_test.go
Introduced separate data-provider address and dedicated DP engine context (dpEngineCtx) for all DP-related operations. Updated market creation, stream handling, and settlement operations to use DP-specific context. Added Proposer configuration in block context for settle_market calls.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

type: chore

Suggested reviewers

  • pr-time-tracker

Poem

🐰 With context refined and assertions precise,
The tests now distinguish with care—
DP engines work true, errors ring through,
Proposers take their rightful share! 🎯

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'test: adjust rewards related test to give provider earning' is directly related to the changes shown in the pull request. The changes modify tests to adjust how data providers are handled in settlement and rewards contexts.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch testDataProv

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/streams/order_book/settlement_payout_test.go (1)

129-130: Redundant assignment.

dataProvider is already set to dpAddr.Address() at line 78. This reassignment is unnecessary.

Suggested fix
-		// Set dataProvider to dpAddr for subsequent attestation and market creation
-		dataProvider = dpAddr.Address()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/streams/order_book/settlement_payout_test.go` around lines 129 - 130,
The assignment dataProvider = dpAddr.Address() is redundant because dataProvider
is already initialized to dpAddr.Address() earlier; remove the duplicate
assignment in settlement_payout_test.go (the second occurrence) to avoid
unnecessary repetition and keep a single initialization of dataProvider tied to
dpAddr.Address().
🤖 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/settlement_payout_test.go`:
- Around line 129-130: The assignment dataProvider = dpAddr.Address() is
redundant because dataProvider is already initialized to dpAddr.Address()
earlier; remove the duplicate assignment in settlement_payout_test.go (the
second occurrence) to avoid unnecessary repetition and keep a single
initialization of dataProvider tied to dpAddr.Address().

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c310ec95-4156-4b1b-8e8e-ea79646fb437

📥 Commits

Reviewing files that changed from the base of the PR and between 8eadcb6 and 1e7f002.

📒 Files selected for processing (2)
  • tests/streams/order_book/create_market_with_components_test.go
  • tests/streams/order_book/settlement_payout_test.go

@MicBun MicBun merged commit 811a0c3 into main Mar 5, 2026
9 checks passed
@MicBun MicBun deleted the testDataProv branch March 5, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant