Skip to content

Add integration test for the buy endpoint recording a price snapshot after each confirmed transaction #752

Description

@Chucks1093

Summary

A price snapshot should be recorded in the database after every confirmed buy, capturing the new supply and price so the price history endpoint has accurate data. An integration test should confirm a snapshot is created for each buy and that the snapshot values match the post-buy contract state.

Scope

  • Execute a buy of 5 keys and assert one price snapshot is created
  • Assert the snapshot supply matches the post-buy supply
  • Assert the snapshot price matches get_price at the new supply
  • Execute a second buy and assert two total snapshots exist for that creator
  • Assert no snapshot is created when a buy fails

Acceptance Criteria

  • One snapshot created per confirmed buy
  • Snapshot supply matches post-buy supply
  • Snapshot price matches on-chain price at new supply
  • No snapshot created on failed buy

ETA: 12 hours


Coordinate on Telegram

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions