Add settlement.simulate claim - #1019
Merged
greatest0fallt1me merged 3 commits intoJul 29, 2026
Merged
Conversation
…claim feat(settlement): add simulate_claim read-only view
Contributor
|
LGTM ✅ merging. Thanks! |
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.
Motivation
withdraw_developer_balancewithout performing state changes or transfers.Description
ClaimSimulationcontaining developer, recipient, token, current and remaining balances, contract liquidity, daily cap and same-day withdrawal state incontracts/settlement/src/lib.rs.simulate_claim(env, developer, amount, to)as a read-only view that reuses the same validation logic aswithdraw_developer_balancebut performs no auth, transfers, storage writes, TTL updates, or events incontracts/settlement/src/lib.rs.contracts/settlement/src/test.rs.contracts/settlement/API.mddescribing the semantics and fields returned bysimulate_claim.Testing
simulate_claimundercontracts/settlement/src/test.rsbut running the package test suite withcargo test -p callora-settlement --libfailed to complete because the build fails in an upstream dependency (soroban-env-host) with aChaCha20Rng/ed25519_dalek::rand_core::CryptoRngtrait mismatch error.rustfmton the modified settlement files successfully, whilecargo fmtof the whole repo reported pre-existing parse errors in unrelated tests (incontracts/vault/src/test.rs).Closes #571