Skip to content

Smart contract tests do not verify STX transfer amounts in events #71

@Mosas2000

Description

@Mosas2000

Description

The test for sending a tip verifies the result is (ok u0) and that there are 2 events, but does not verify the actual STX amounts transferred. For a 1,000,000 uSTX tip with a 0.5% fee, the events should show a 995,000 uSTX transfer to the recipient and a 5,000 uSTX transfer to the contract owner. These amounts are not validated.

File

tests/tipstream.test.ts, lines 12-23

Suggested Fix

Extract individual STX transfer events and verify:

  • Event 1: sender is wallet1, recipient is wallet2, amount is 995000
  • Event 2: sender is wallet1, recipient is deployer (contract owner), amount is 5000

This ensures the fee calculation and distribution work correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions