Skip to content

Add integration tests for sell event KeySold fields (#667) - #695

Merged
Chucks1093 merged 2 commits into
accesslayerorg:mainfrom
shogun444:test/667-sell-event-key-sold-integration-test
Jul 29, 2026
Merged

Add integration tests for sell event KeySold fields (#667)#695
Chucks1093 merged 2 commits into
accesslayerorg:mainfrom
shogun444:test/667-sell-event-key-sold-integration-test

Conversation

@shogun444

Copy link
Copy Markdown
Contributor

Summary

Added integration test coverage for the KeySold event to strengthen sell-side event verification and ensure emitted data remains consistent with on-chain state.

What changed?

  • Added an integration test to verify the sell_key() return value matches the post-transaction on-chain key supply across successive sells.
  • Added an integration test to ensure no KeySold event is emitted when a sell transaction fails due to insufficient balance.
  • Added an integration test to verify the emitted proceeds value matches the corresponding sell quote payout.
  • Extended sell event coverage without modifying the contract or event schema.

Why was it changed?

While the existing test suite already validated the KeySold event payload, it did not verify that:

  • the returned supply matched the contract's on-chain state after a successful sell,
  • failed sell operations emitted no KeySold events, or
  • the event payout remained consistent with the contract's quoted sell proceeds.

These additional integration tests improve confidence in event correctness for indexers and downstream consumers while protecting against future regressions.


Closes #667

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --test sell_event_fields

Note: cargo test --workspace currently has a pre-existing compilation failure in co_creator_fee_split_invariant.rs on the base branch, unrelated to this change.

Checklist

  • Linked issue or backlog item
  • Added or updated creator-keys integration tests covering successful and failure paths
  • Ran cargo fmt --all -- --check
  • Ran cargo clippy --workspace --all-targets -- -D warnings
  • Ran relevant tests for the modified functionality
  • No storage layout changes
  • Event schema remains unchanged
  • No public contract interface changes
  • Scope limited to integration test coverage only

- new_supply: verify sell_key return value matches on-chain supply
- no event on failed sell: filter for SELL_EVENT_NAME events only
- payout cross-check: event proceeds match sell_quote.total_amount
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@shogun444 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

- Add missing 7th argument (whitelist: Option<WhitelistConfig>)
- Move &Some(config) from curve_preset (arg 5) to co_creator (arg 6)
@Chucks1093
Chucks1093 merged commit 6e0f7f2 into accesslayerorg:main Jul 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add integration test for the sell function emitting the correct KeySold event with seller and payout fields

2 participants