Skip to content

Add integration test for buy event emitted with correct fields on successful purchase #576

Description

@Chucks1093

Summary

The buy function emits a contract event on success but no integration test verifies the event fields are correct. A test should perform a buy transaction and assert the emitted event contains the expected buyer, creator, quantity, price, and timestamp fields.

Scope

  • Deploy the contract and perform a buy of 1 key for a seeded creator
  • Extract the contract events from the transaction result meta
  • Assert one buy event is emitted with fields: buyer, creator_id, quantity, price_paid, ledger
  • Assert field values match the transaction inputs and current ledger number

Acceptance Criteria

  • Exactly one buy event emitted per transaction
  • All five fields present with correct values
  • price_paid matches bonding curve price at the supply step before the buy
  • ledger matches the transaction ledger number

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