Skip to content

Add regression test for protocol treasury balance unchanged after fai…#379

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
Kingvic300:test/protocol-treasury-balance-unchanged-after-failed-trade
May 31, 2026
Merged

Add regression test for protocol treasury balance unchanged after fai…#379
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
Kingvic300:test/protocol-treasury-balance-unchanged-after-failed-trade

Conversation

@Kingvic300
Copy link
Copy Markdown
Contributor

…led trade

When a trade fails, no fees should reach the protocol treasury. These tests record the read-only treasury balance before a trade expected to fail, trigger the failing trade, and assert the balance is identical afterward, confirming no partial fee transfer occurs on the error path.

Covers a buy failure (InsufficientPayment, plus NotRegistered against a seeded non-zero treasury) and a sell failure (InsufficientBalance).

Closes #371

Summary

Testing

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

Checklist

  • Linked issue or backlog item
  • Contract behavior and invariants are described clearly
  • Docs updated if contract interfaces or workflows changed
  • Scope stays limited to one contract concern

CLoses: #371

…led trade

When a trade fails, no fees should reach the protocol treasury. These
tests record the read-only treasury balance before a trade expected to
fail, trigger the failing trade, and assert the balance is identical
afterward, confirming no partial fee transfer occurs on the error path.

Covers a buy failure (InsufficientPayment, plus NotRegistered against a
seeded non-zero treasury) and a sell failure (InsufficientBalance).

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

drips-wave Bot commented May 31, 2026

@Kingvic300 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 9c2cc3c into accesslayerorg:main May 31, 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 protocol treasury balance unchanged after failed trade

2 participants