test: add test helpers, docs, and regression tests#351
Merged
Conversation
- 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
|
@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! 🚀 |
Resolves accesslayerorg#342 Resolves accesslayerorg#343 Resolves accesslayerorg#344 Resolves accesslayerorg#345
Resolves accesslayerorg#342 Resolves accesslayerorg#343 Resolves accesslayerorg#344 Resolves accesslayerorg#345
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
#343 - Add docs for contract versioning approach and WASM hash tracking
#344 - Add regression test for sell event containing correct seller address
#345 - Add unit tests for protocol config initialized flag read after setup