Skip to content

[Phase E5] Add atomic batch escrow creation - #147

Open
Adesokan-2 wants to merge 3 commits into
DocForum:mainfrom
Adesokan-2:fix/issue-28
Open

Adesokan-2 wants to merge 3 commits into
DocForum:mainfrom
Adesokan-2:fix/issue-28

Conversation

@Adesokan-2

@Adesokan-2 Adesokan-2 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Adds create_escrows for atomic creation of up to five escrows in one call. It validates items before transfer, checks aggregate balance deltas per token, returns IDs in input order, and identifies invalid item indexes through dedicated error codes. Includes regression coverage for mixed tokens, ordering, rollback, and the batch-size bound. The five-item cap is a conservative initial bound pending resource measurements.

The generated SDK binding and testnet deployment are not updated in this change.

Closes #28

@drips-wave

drips-wave Bot commented Oct 16, 2026

Copy link
Copy Markdown

@Adesokan-2 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! 🚀

Learn more about application limits

@afeezorobsco-cyber

Copy link
Copy Markdown
Contributor

@Adesokan-2

This PR has merge conflicts with main, which has moved on since this branch was created. Please rebase onto the latest main (or merge main into your branch), resolve the conflicts, and push. CI will then re-run, and the PR can be merged once it's conflict-free, CI is green and it's been reviewed. Thanks!

@afeezorobsco-cyber

Copy link
Copy Markdown
Contributor

@Adesokan-2 Thanks for the PR. It can't be merged yet. To unblock it:

CI is failing. Here's what broke:

Soroban contract (test + wasm build):

error[E0308]: mismatched types
error: could not compile `docforum-escrow` (lib) due to 1 previous error; 1 warning emitted
error: could not compile `docforum-escrow` (lib test) due to 1 previous error; 1 warning emitted

Please fix these errors and run the same steps locally before pushing (npm run typecheck && npm test && npm run build, or cargo test for contracts).

Merge conflicts: this branch conflicts with main. Please rebase onto the latest main (git fetch upstream && git rebase upstream/main), resolve the conflicts (often ROADMAP.md, ARCHITECTURE*.md or prisma/schema.prisma), and force-push.

Push to this same branch and CI will re-run. Once it's green and conflict-free, it'll be reviewed for merge.

@github-actions github-actions Bot added the needs-rebase Has merge conflicts with main; the author needs to rebase label Oct 20, 2026
@Adesokan-2

Copy link
Copy Markdown
Contributor Author

@afeezorobsco-cyber I merged the current main changes, fixed the batch creation CI failure, and added the regression tests and generated bindings. Please review and merge when ready.

@github-actions github-actions Bot added needs-rebase Has merge conflicts with main; the author needs to rebase and removed needs-rebase Has merge conflicts with main; the author needs to rebase labels Oct 20, 2026
@github-actions

Copy link
Copy Markdown

@Adesokan-2 This PR now has merge conflicts with main, most likely because #149 ([Phase E5] Add opt-in payee acceptance before release) was just merged, so it can't be merged until it's rebased:

git fetch upstream            # upstream = https://github.com/DocForum/docforum-escrow.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-lease

The usual culprits are shared files like ROADMAP.md and ARCHITECTURE*.md. CI re-runs when you push, and the needs-rebase label is removed automatically once the conflicts are resolved.

Automated message. It won't repeat unless the PR conflicts again after your next push.

@afeezorobsco-cyber

Copy link
Copy Markdown
Contributor

@Adesokan-2 Heads-up: #268 just changed how contract PRs work in this repo. Your PR changes contracts/escrow/src/lib.rs, so CI's new "Contract changes use a fragment, not a version bump" step will fail it until you make these changes (details in contract-changes.d/README.md):

  1. Don't edit CONTRACT_VERSION when you merge main (currently 2.3.0). Keep main's line as it is.

  2. Add a fragment, e.g. contract-changes.d/28-phase-e5-add-atomic-batch-escrow-creatio.md:

    bump: minor
    ---
    Issue #28: one-paragraph summary of the contract change.

    Use patch for a behaviour fix with no interface change, minor for new entry points, arguments, events or errors, and major for breaking changes.

  3. Switch your new Error codes to provisional ones (issue number × 100 + n). This branch adds InvalidBatchSize = 30, InvalidBatchItem0 = 31, InvalidBatchItem1 = 32, InvalidBatchItem2 = 33, InvalidBatchItem3 = 34, InvalidBatchItem4 = 35, BatchAmountOverflow = 36; use InvalidBatchSize = 2800, InvalidBatchItem0 = 2801, InvalidBatchItem1 = 2802, InvalidBatchItem2 = 2803, InvalidBatchItem3 = 2804, InvalidBatchItem4 = 2805, BatchAmountOverflow = 2806. The fold assigns the final numbers. Don't renumber existing codes.

This should also make your next merge from main much easier: the version line was the one thing every contract PR conflicted on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Has merge conflicts with main; the author needs to rebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Phase E5] Batch creation of escrows in a single invocation

2 participants