fix: repair main's broken build and a negative-releasable bug across … - #432
Merged
ritaifeoluwa merged 1 commit intoSep 27, 2026
Conversation
…factory/farming-pool/vesting-wallet main did not compile or pass tests against the pinned soroban-sdk 25.3.1 due to several unrelated, recently-merged bugs: - farming-pool: duplicate `PoolInfo` import broke the crate (and anything depending on its WASM output, i.e. factory). - vesting-wallet: `Address::default()` doesn't exist in this SDK; switched to the zero-address strkey pattern already used elsewhere in the codebase. - vesting-wallet: `releasable`/`releasable_amount` used `i128::saturating_sub`, which only guards overflow, not negativity. After `emergency_withdraw`, `release()` could attempt to transfer a negative token amount. Clamped with `.max(0)`. - factory: a bad merge left two versions of `create_pool` concatenated (with an unclosed brace and dead code), and silently regressed `min_stake_amount == 0` from "default to minimum" to "reject". Rewrote it as a thin delegate to `create_pool_inner`, matching `create_pools_batch` and the already-tested behavior. - factory: added the missing `RefreshPoolTtlsResponse` type. - Several tests asserted on `events().all()` as if it accumulated across multiple top-level calls; it only reflects the most recent one. Fixed assertions in vesting-wallet and factory tests to match actual semantics (and the pattern already used elsewhere in farming-pool's own tests). - farming-pool tests: removed stale `.unwrap()` calls on getters that return plain values (not `Result`) via the generated client. - factory's integration test: updated stale `unstake(user)` call sites for `unstake`'s new `amount` parameter, and regenerated the checked-in `farming_pool.wasm` fixture per its own documented procedure. 354/354 tests now pass across factory (83 unit + 9 integration), farming-pool (202), and vesting-wallet (60), and the release WASM builds cleanly for the whole workspace.
|
@OlolaJaco 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! 🚀 |
✅ Deploy Preview for sdcontracts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Closes #415 (vesting-wallet re-init guard) — vesting-wallet/src/lib.rs initialize() already rejects a second call.
Closes #416 (factory pool_count_by_asset index) — AssetPoolCount index already implemented and maintained in create_pool_inner.
Closes #417 (farming-pool lock-period bypass) — unlock_assets already enforces the lock unconditionally for partial and full withdrawals.
Closes #418 (factory transfer_admin event test) — test_transfer_admin_emits_event_with_old_and_new_admin already exists and passes.