Skip to content

fix(escrow): resolve overlapping return statements in invokeRelease (#485) - #693

Merged
chonilius merged 2 commits into
MergeFi:mainfrom
alansamdev:fix/485-invoke-release-bad-merge
Oct 15, 2026
Merged

chonilius merged 2 commits into
MergeFi:mainfrom
alansamdev:fix/485-invoke-release-bad-merge

Conversation

@alansamdev

@alansamdev alansamdev commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem

main @ 50647ca does not compile:

src/escrow/escrow.service.ts(594,5): error TS1135: Argument expression expected.

EscrowService.invokeRelease contained both sides of a bad merge:

Because of this syntax error, nest build fails and nothing on main can be deployed. Release, split release and refund are the platform's core money paths, and they all live in this service.

Why simply picking one side is wrong

What changed

  1. fix(escrow) in src/escrow/escrow.service.ts: invokeRelease is now a single invokeOnLockedEscrow call that passes u64(this.onChainKeyFor(escrow)) and manager. The SorobanClientService.toScVal encodes every bigint argument as i128, even where the documented contract signature calls for u64 #301 comment is kept.
  2. test(escrow) in src/escrow/escrow.service.spec.ts: a new regression test on the splitRelease path checks both halves at once:
    • args[0] is u64(4850n), not a bare bigint;
    • on a Soroban failure, lastFailure (operation splitRelease) is saved through dataSource.manager.save.

Verification

  • npx tsc --noEmit: the TS1135 error in escrow.service.ts is gone.
  • npx jest src/escrow/escrow.service.spec.ts: 58/59 pass, including the new test and the existing u64(8801n) / manager assertions. The one failure, fund › locks funds… (typeof args[4] expected bigint), is a separate problem in fund that this PR does not touch.

Related: #301, #303
Closes #485
Closes #486
Closes #488
Closes #317

Keep a single invokeOnLockedEscrow call that carries both the u64-typed
issue key (MergeFi#301) and the transaction manager (MergeFi#303), restoring compilation.
splitRelease must send u64(issue_id) and record failures through the
locking transaction manager.
@drips-wave

drips-wave Bot commented Oct 15, 2026

Copy link
Copy Markdown

@alansamdev 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

@vercel

vercel Bot commented Oct 15, 2026

Copy link
Copy Markdown

@alansamdev is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@chonilius
chonilius merged commit 5a151c8 into MergeFi:main Oct 15, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment