refactor: update tests for Soroban SDK 22.x compatibility and improve… - #628
Merged
github-actions[bot] merged 1 commit intoAug 25, 2026
Merged
Conversation
… test suite structure
3 tasks
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.
Description
Stabilized the Soroban smart contract test suite to achieve 100% compatibility with Soroban SDK 22.x and
#![no_std]constraints. This PR resolves test failures stemming from RLP borrow-checker lifetime errors, SDK method updates, contract storage context restrictions, and missing test helper contract implementations.Closes #526
Key Changes Made
1. SDK 22.x Storage & Host Context Alignment
vault_tests.rs: Replacedenv.current_contract_address()calls in test bodies withclient.addressto fixHostError: Current context has no contract ID.sdk_compatibility_tests.rs&capability_token.rs: Wrapped directenv.storage()calls withinenv.as_contract(&contract_id, || { ... })blocks to satisfy SDK 22.x execution context requirements.2. Test Infrastructure & Mocking Fixes
tests.rs(MaliciousToken): Added SEP-41 metadata getters (name,symbol,decimals) toMaliciousTokensoclient.initcached token metadata queries succeed during reentrancy testing.bls_tests.rs&list_tests.rs: Replaced generic dummy addresses inclient.inittoken parameters with registered Stellar Asset Contracts viaenv.register_stellar_asset_contract_v2.list_tests.rs: Updated#[should_panic]attributes to align with SDK 22.x contract error panic formatting.3. RLP & Proptest Ownership Fixes
rlp.rs&tests.rs: Fixed borrow checker lifetime issues (E0716) by binding temporary slice literals to local variables before decoding.rounding.rs&tests.rs: Resolved ownership move errors (E0382) by explicitly cloning identifier symbols before proptest assertions.Verification
Executed full test suite with test utilities enabled:
cargo test --features testutils