Skip to content

Add integration test for the price preview endpoint returning the correct buy cost for a given quantity at the current supply #698

Description

@Chucks1093

Summary

The price preview endpoint lets users see the XLM cost of buying N keys before committing. An integration test should confirm the preview returns the correct cost at different supply levels and that it is consistent with what the buy endpoint actually charges.

Scope

  • Seed a creator with supply 10 and query the preview for buying 5 keys
  • Assert the returned cost matches the bonding curve formula for supply 10, amount 5
  • Seed a creator with supply 50 and assert the cost is higher than at supply 10 for the same amount
  • Assert the preview does not mutate any server or contract state
  • Assert the response includes gross_cost, fee, and net_cost fields

Acceptance Criteria

  • Correct cost returned for supply 10, amount 5
  • Higher supply returns higher cost for the same amount
  • No state mutated by calling the preview endpoint
  • Response includes gross_cost, fee, and net_cost

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions