Skip to content

Add integration test for the contract correctly handling a buy and immediate sell in the same ledger without state corruption #699

Description

@Chucks1093

Summary

A buy and sell in the same ledger must each see the correct supply: the sell must observe the supply after the buy, not the pre-buy value. An integration test should submit both operations in the same ledger and verify the final supply and holder count are consistent.

Scope

  • Submit a buy of 5 keys and a sell of 5 keys in the same ledger
  • Assert the final supply equals the supply before the buy (net zero change)
  • Assert the holder count returns to the pre-buy value if the wallet sold all its keys
  • Assert no intermediate state is observable between the two operations
  • Assert the buy event new_supply and sell event new_supply are consistent with the sequence

Acceptance Criteria

  • Final supply equals pre-buy supply after net-zero buy+sell
  • Holder count returns to pre-buy value
  • Buy and sell events have consistent new_supply values
  • No state corruption from same-ledger operations

ETA: 12 hours


Coordinate on Telegram

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