Skip to content

test: add sell quote vs execution proceeds regression#338

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
wheval:fix/issues-304
May 29, 2026
Merged

test: add sell quote vs execution proceeds regression#338
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
wheval:fix/issues-304

Conversation

@wheval
Copy link
Copy Markdown
Contributor

@wheval wheval commented May 29, 2026

Summary

Adds a regression test that calls get_sell_quote before sell_key and asserts the quoted seller net (total_amount) exactly matches proceeds derived from the execution fee path, with zero divergence.

Purpose / Motivation

Sell quotes and sell execution use separate code paths. A mismatch between the quoted payout and the fees applied at execution would break client trust and can cause financial discrepancies. This test closes that gap by verifying both paths agree for the same (creator, holder) inputs.

Changes Made

  • New integration test creator-keys/tests/sell_quote_matches_execution.rs
  • Covers two supply levels (1 and 5 keys) before the sell
  • Asserts quote.total_amount equals execution-path net proceeds (price - fees) before and after sell_key
  • Asserts the difference between quoted and actual proceeds is exactly zero

How to Test

  1. From the repo root: cargo test -p creator-keys --test sell_quote_matches_execution
  2. Expected: both test_sell_quote_proceeds_match_execution_at_supply_one and test_sell_quote_proceeds_match_execution_at_supply_five pass
  3. Optional full suite: cargo test -p creator-keys

Screenshots (if applicable)

N/A — contract tests only.

Breaking Changes

  • None.

Related Issues

Closes #304

Checklist

  • Code builds successfully
  • Tests added/updated
  • No console errors
  • Documentation updated (if needed)

Assert get_sell_quote total_amount matches execution-path net proceeds
at supply levels 1 and 5 before and after sell_key.

Closes accesslayerorg#304
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@wheval 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

@Chucks1093 Chucks1093 merged commit f8b4003 into accesslayerorg:main May 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 regression test for sell quote matching actual sell proceeds

2 participants