Skip to content

test: align Pyth mocks with listDynamicFields; relax e2e market OI; match USDC error copy#12

Merged
JustaLiang merged 5 commits intomainfrom
fix/e2e-market-oi-assertions
Apr 7, 2026
Merged

test: align Pyth mocks with listDynamicFields; relax e2e market OI; match USDC error copy#12
JustaLiang merged 5 commits intomainfrom
fix/e2e-market-oi-assertions

Conversation

@do0x0ob
Copy link
Copy Markdown
Contributor

@do0x0ob do0x0ob commented Apr 3, 2026

This branch updates tests in three areas:

  1. Pyth unit tests — Mocks now discover the price table via listDynamicFields (childId + valueType containing the PriceIdentifier), matching the gRPC-oriented code path. Scenarios and descriptions were updated; added coverage for empty / non-matching field lists where relevant.
  2. Tx builder unit tests — Expectations for the “no coins” failure now match the current message (No USDC coins).
  3. E2E simulate / view — getMarketSummary no longer asserts fixed longOi on public testnet. Added expectMarketOiFieldsParsed to require bigint OI fields and non-negative values so parsing bugs still fail while live OI can vary.

do0x0ob added 5 commits April 3, 2026 10:51
- Replace fixed longOi expectations with bigint + non-negative checks
- Add expectMarketOiFieldsParsed helper to catch missing/wrong types

Made-with: Cursor
- Remove unused BaseAsset import and WLP_TYPE from setup-oracle.ts
- Apply prettier --write across src, test, scripts per lint:prettier

Made-with: Cursor
Copy link
Copy Markdown
Contributor

@bucket-bot bucket-bot left a comment

Choose a reason for hiding this comment

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

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Rex (OpenClaw)

Copy link
Copy Markdown
Contributor

@bucket-bot bucket-bot left a comment

Choose a reason for hiding this comment

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

Code review

No actionable issues found. Here's a summary of what was checked:

What this PR does: Pure test alignment + formatter pass — no production logic changes. Three areas updated:

  1. Pyth unit tests now mock listDynamicFields (with childId + valueType) to match the already-merged gRPC-oriented production code path; getDynamicFields is gone.
  2. Several tests that previously expected success now correctly expect /Price table not found/ — this tightens requirements: childId is required (not objectId), valueType must be non-empty (not substituted by objectType).
  3. E2E OI assertions relaxed from hardcoded 0n/1n to expectMarketOiFieldsParsed — correct approach for a live testnet.

Agents run:

  • ✅ Bug Detection — no logic changes in src/ (formatting only); test behavioral changes are intentional and aligned with prior production code updates
  • ✅ CLAUDE.md Compliance — naming conventions respected, import ordering follows style
  • ✅ Silent Failure Hunter — no new try/catch or error suppression introduced
  • ✅ Comment Accuracy — test descriptions updated to accurately reflect new expected behavior
  • ⏭️ Dependency Security — no package.json changes
  • ⏭️ Type Design — no new types added

Decision: ✅ Approved — clean test housekeeping, no issues ≥ 80 confidence.

🤖 Generated with Jarvis (OpenClaw)

@JustaLiang JustaLiang merged commit aa5d842 into main Apr 7, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants