Skip to content

test: add test helpers, docs, and regression tests#351

Merged
Chucks1093 merged 9 commits into
accesslayerorg:mainfrom
rayvorden:test-improvements
May 29, 2026
Merged

test: add test helpers, docs, and regression tests#351
Chucks1093 merged 9 commits into
accesslayerorg:mainfrom
rayvorden:test-improvements

Conversation

@rayvorden
Copy link
Copy Markdown
Contributor

What

Comprehensive test improvements including a balance computation helper, contract versioning documentation, sell event regression test, and initialized flag unit tests.

Issues Resolved

Closes #342
Closes #343
Closes #344
Closes #345

Changes

#342 - Add helper for computing expected key balance after mixed buy and sell sequence

  • Add TradeOperation enum (Buy/Sell) for representing trade sequences
  • Implement compute_expected_balance_after_trades helper in contract_test_env
  • Create comprehensive test suite (balance_after_mixed_trades.rs) with three test cases
  • Tests verify balance tracking with various buy/sell sequence patterns
  • Helper makes test intent explicit and reduces maintenance burden on complex fixtures

#343 - Add docs for contract versioning approach and WASM hash tracking

  • Document semantic versioning approach and release numbering strategy
  • Explain WASM hash as deployment identifier and version indicator
  • Provide instructions for retrieving contract WASM hash from Stellar blockchain
  • Include build verification procedures and determinism considerations
  • Document canonical hash recording and verification workflow
  • Add best practices for operators, contributors, and users
  • Include emergency procedures for hash mismatch scenarios

#344 - Add regression test for sell event containing correct seller address

  • Create dedicated test file (sell_event_seller_address.rs) focusing on seller address integrity
  • Test verifies seller address field in sell event matches call initiator
  • Assert event field is present and contains correct address value
  • Separate tests for address match and field presence validation

#345 - Add unit tests for protocol config initialized flag read after setup

  • Add test verifying initialized flag is false before any initialization
  • Covers pre-initialization state as distinct test case
  • Complements existing post-initialization test
  • Uses consistent setup conventions throughout

rayvorden added 4 commits May 29, 2026 17:36
- Add TradeOperation enum (Buy/Sell) for representing trade sequences
- Add compute_expected_balance_after_trades helper to contract_test_env
- Add new test file balance_after_mixed_trades.rs with three test cases
- Tests verify balance tracking with various buy/sell sequences
- Helper makes test intent explicit and reduces maintenance burden

Resolves accesslayerorg#342
- Document semantic versioning approach and release numbering
- Explain WASM hash as deployment identifier and version indicator
- Provide instructions for retrieving contract WASM hash from blockchain
- Include build verification procedures and determinism considerations
- Document canonical hash recording and verification workflow
- Add best practices for operators, contributors, and users
- Include emergency procedures for hash mismatch scenarios

Resolves accesslayerorg#343
- Add dedicated test verifying seller address field in sell event
- Assert seller address matches the call initiator (regression prevention)
- Verify event field is present and contains correct address
- Test covers field presence and value integrity separately

Resolves accesslayerorg#344
- Add test verifying initialized flag is false before any initialization
- Covers pre-initialization state as distinct test case
- Complements existing post-initialization test
- Uses same setup conventions and pattern

Resolves accesslayerorg#345
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@rayvorden 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 2adb42e 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

2 participants