Skip to content

forge-oracle — add test verifying set_max_price_deviation() correctly blocks submissions exceeding the threshold #337

@Austinaminu2

Description

@Austinaminu2

Summary

set_max_price_deviation() is implemented and submit_price() uses it, but there is no test verifying the end-to-end flow: set a deviation threshold, submit an initial price, then verify a large price change is blocked and a small one is accepted.

Tasks

  • Submit initial price of 10_000_000 (1.0 USDC)
  • Call set_max_price_deviation(1000) (10% max deviation = 1000 bps)
  • Attempt submit_price with 11_100_000 (11.1% increase) — assert PriceDeviationTooHigh
  • Attempt submit_price with 10_900_000 (9% increase) — assert success
  • Attempt submit_price with 9_000_000 (17% decrease from 10.9M) — assert PriceDeviationTooHigh
  • Call set_max_price_deviation(0) to disable — verify previously blocked price now succeeds

Labels: testing, forge-oracle

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions