Skip to content

test: harden Morpho Pendle PT oracle assertions - #181

Open
piyushbag wants to merge 2 commits into
sparkdotfi:masterfrom
piyushbag:fix/93-morpho-pendle-warp-tests
Open

test: harden Morpho Pendle PT oracle assertions#181
piyushbag wants to merge 2 commits into
sparkdotfi:masterfrom
piyushbag:fix/93-morpho-pendle-warp-tests

Conversation

@piyushbag

@piyushbag piyushbag commented Jul 21, 2026

Copy link
Copy Markdown

Summary

  • Guard _testMorphoPendlePTOracleConfig when PT decimals exceed loan token decimals
  • Add 7-day and 30-day warp checks for Pendle PT oracle price decay

Test plan

  • forge build

Summary by CodeRabbit

  • Tests
    • Improved test setup for deployments with preconfigured payload addresses.
    • Prevented unnecessary redeployment of existing spell payloads during test initialization.

Allow spell tests to register on-chain payload addresses before setUp and skip redeploying them.

Fixes sparkdotfi#90
Handle loan tokens with fewer decimals than PT and add additional warp-based price decay checks.

Fixes sparkdotfi#93
@octane-security-app

Copy link
Copy Markdown

Summary by Octane

New Contracts

No new contracts were added.

Updated Contracts

  • SpellRunner.sol: The contract update includes an early return if a payload already exists and introduces a function to set payload addresses for chains.

🔗 Commit Hash: 3b44f87

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3557eace-9a88-47d6-96f7-425ee0120f44

📥 Commits

Reviewing files that changed from the base of the PR and between c24ddf5 and 3b44f87.

📒 Files selected for processing (2)
  • src/proposals/20260716/Spell_20260716.t.sol
  • src/test-harness/SpellRunner.sol

Walkthrough

SpellRunner now supports pre-registered payload addresses and avoids redeploying them. Three spell test constructors register Ethereum, Robinhood, and XLayer payload addresses during construction instead of setup.

Changes

Payload registration flow

Layer / File(s) Summary
Harness payload handling
src/test-harness/SpellRunner.sol
Adds _setPayloadAddress and skips payload deployment when a chain already has a non-zero payload address.
Spell test wiring
src/proposals/20260716/Spell_20260716.t.sol
Moves Ethereum, Robinhood, and XLayer payload address configuration from setUp() into the constructors of three test contracts.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: supercontracts, certora-spark-review, themj0ln1r

Poem

A bunny found payloads tucked away,
No need to plant them twice today.
Three constructors set the trail,
Ethereum, Robinhood, XLayer prevail.
Hop, hop—the harness knows the way!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title is descriptive and properly prefixed, but it is missing the required trailing Linear identifier in parentheses. Add the required SC- issue number in parentheses at the end of the title.
Description check ⚠️ Warning The description only includes Summary and Test plan, but the repository template requires forum, dependencies, addresses, notes, and deployment conditions sections. Fill in the missing template sections, including forum post, dependencies, addresses table, reviewer notes, and all required condition checklists.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@octane-security-app

Copy link
Copy Markdown

Overview

Warnings found: 1                                                                                

🔗 Commit Hash: 3b44f87
🛡️ Octane Dashboard: All vulnerabilities

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.

1 participant