fix(settlement): fix 41+ pre-existing SDK 22 compilation errors in te…#459
Merged
greatest0fallt1me merged 3 commits intoJun 26, 2026
Merged
Conversation
…st.rs and test_views.rs - panic_message: downcast to String instead of &&str for no_std compat - is_error: handle Err(Ok(Error)) pattern for non-Result fn panics (SDK 22) - is_error_vec/is_error_result: helpers for Result<SettlementError, InvokeError> slot - All try_get_all_developer_balances/try_get_developer_balances_page: double unwrap - is_not_initialized: match Err(Ok(Error)) with is_type/get_code - GasExhaustionRisk assertion: Err(Ok(...)) wrapping - Pre-existing page size cap test: 51 not 50
|
@Phantomcall 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! 🚀 |
…_pool tests, fix vault clippy errors
3 tasks
Contributor
|
the SDK 22 compile-fix work — merged 🙏 reconciled onto current main. |
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.
Multi-Asset Settlement (#417)
Adds per-token developer balances and asset parameter on
receive_payment.New Storage Keys
DeveloperBalanceByAsset(Address, Address)— developer → asset → balanceGlobalPoolByAsset(Address)— asset → global poolSupportedAssets— registered asset whitelistNew Error Variants
AssetNotConfigured = 13— unregistered asset rejectedGasExhaustionRisk = 14— added (already referenced by existing tests)New Functions
add_asset(admin, asset)— admin-only asset registration (prevents unregistered token dust)get_assets(admin)— list supported assetsreceive_payment_asset(caller, amount, to_pool, developer, asset)— asset-aware paymentwithdraw_developer_balance_asset(developer, amount, asset)— per-asset withdrawalget_developer_balance_asset(developer, asset)— per-asset viewget_global_pool_asset(asset)— per-asset pool viewget_all_developer_balances_asset(admin, asset)— per-asset admin viewBackwards Compatibility
receive_payment(4-param, old signature) kept as shim callingreceive_payment_assetwith the native asset. Same pattern forwithdraw_developer_balance,get_developer_balance,get_global_pool, andget_all_developer_balances.SDK 22 Test Fixes
Fixes 41+ pre-existing compilation errors and 20 runtime failures in
settlement/src/test.rsandtest_views.rscaused by Soroban SDK 22 changes totry_client method signatures:panic_message:downcast_ref<&str>→downcast_ref<String>(no_std compat)is_error: matches bothErr(Ok(Error))(non-Result fn panics in SDK 22) andErr(Err(InvokeError::Contract(code)))is_error_vec/is_error_result/is_not_initialized_result: handleResult<SettlementError, InvokeError>error slottry_get_all_developer_balances/try_get_developer_balances_page: double.unwrap().unwrap()GasExhaustionRiskassertion: wrapped inErr(Ok(...))is_not_initialized: usesis_type(ScErrorType::Contract) + get_code()for SDK 22ErrortypeMAX_DEVELOPER_BALANCES_PAGE_SIZE = 100)closes #417