Skip to content

refactor: update tests for Soroban SDK 22.x compatibility and improve… - #628

Merged
github-actions[bot] merged 1 commit into
Sahara-Pay:mainfrom
Fatimasanusi:design/integrate
Aug 25, 2026
Merged

refactor: update tests for Soroban SDK 22.x compatibility and improve…#628
github-actions[bot] merged 1 commit into
Sahara-Pay:mainfrom
Fatimasanusi:design/integrate

Conversation

@Fatimasanusi

Copy link
Copy Markdown
Contributor

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: Replaced env.current_contract_address() calls in test bodies with client.address to fix HostError: Current context has no contract ID.
  • sdk_compatibility_tests.rs & capability_token.rs: Wrapped direct env.storage() calls within env.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) to MaliciousToken so client.init cached token metadata queries succeed during reentrancy testing.
  • bls_tests.rs & list_tests.rs: Replaced generic dummy addresses in client.init token parameters with registered Stellar Asset Contracts via env.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

@github-actions
github-actions Bot merged commit 0e52acb into Sahara-Pay:main Aug 25, 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.

Implement delegate voting weight aggregation for tokenized fractional assets

1 participant