Skip to content

test(session): add TODO for fee-payer sponsored settle/close tests#248

Closed
brendanjryan wants to merge 1 commit intofix/settle-sender-separationfrom
fix/settle-sender-feepayer-tests
Closed

test(session): add TODO for fee-payer sponsored settle/close tests#248
brendanjryan wants to merge 1 commit intofix/settle-sender-separationfrom
fix/settle-sender-feepayer-tests

Conversation

@brendanjryan
Copy link
Copy Markdown
Collaborator

Follow-up to #247. Adds TODO comments for on-chain fee-payer tests with distinct sender ≠ feePayer.

During development we discovered that localnet's msg.sender resolves to the fee payer address in sponsored 0x76 txs, so the escrow contract's settle() / close() revert with NotPayee() when sender ≠ feePayer. These tests need a testnet or mainnet environment.

The existing tests still cover:

  • settles a channel — unsponsored settle via writeContract
  • settles with explicit account (no fee payer) — validates the new account param is used as sender
  • throws when no account available — fail-fast when neither account nor client.account is set
  • Equivalent close tests

Stacked on #247.

The escrow contract requires msg.sender == payee for settle() and
close(). The sendFeePayerTx helper used the fee payer as both sender
and gas sponsor, causing every fee-sponsored settlement/close to
revert with NotPayee().

Fix sendFeePayerTx to accept a separate account (logical sender)
and feePayer (gas sponsor). Update settleOnChain and closeOnChain
to resolve and pass the correct account. Add account option to
the top-level tempo.settle() API.

Also fix feeToken resolution to use resolveCurrency() which falls
back to pathUsd for unknown chain IDs (e.g. localnet).
@brendanjryan brendanjryan deleted the fix/settle-sender-feepayer-tests branch March 26, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant