Skip to content

feat: allow processor to be unlock destination#188

Open
mpetrun5 wants to merge 3 commits into
mainfrom
feat/allow-processor-to-be-unlock-destination
Open

feat: allow processor to be unlock destination#188
mpetrun5 wants to merge 3 commits into
mainfrom
feat/allow-processor-to-be-unlock-destination

Conversation

@mpetrun5
Copy link
Copy Markdown
Collaborator

@mpetrun5 mpetrun5 commented May 13, 2026

Description

Related Issue Or Context

Closes: #181

How Has This Been Tested? Testing details.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Checklist:

  • I have commented my code, particularly in hard-to-understand areas.
  • I have ensured that all acceptance criteria (or expected behavior) from issue are met
  • I have updated the documentation locally and in docs.
  • I have added tests to cover my changes.
  • I have ensured that all the checks are passing and green, I've signed the CLA bot

@github-actions
Copy link
Copy Markdown

Go Test coverage is 36.7 %\ ✨ ✨ ✨

@mpetrunic mpetrunic requested review from Copilot and removed request for tcar121293 May 14, 2026 12:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the LiFi unlock-signing flow so the EIP-712 destination (repayment destination) can be routed either to the standard repayer or to a per-token “processor” address, enabling repayments to processors when the input token differs from the borrow token (Issue #181).

Changes:

  • Add borrowToken to unlock requests and return the computed repaymentAddress in the API response.
  • Update LifiUnlockHandler to fetch the order, resolve the input token symbol, and select either the repayer or a configured processor as the unlock destination.
  • Add EVM config wiring for per-chain repayment processors and expand tests/mocks accordingly.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Makefile Adds mock generation for the new unlock handler interfaces.
go.mod Promotes github.com/lmittmann/w3 to a direct dependency; bumps solver-config version.
go.sum Updates sums for module version changes.
chains/evm/message/unlock.go Adds order/token-based destination selection and plumbs repayment destination through the handler.
chains/evm/message/unlock_test.go Adds tests for repayer vs processor destination selection.
chains/evm/message/mock/unlock.go Adds generated GoMock mocks for the new interfaces (LifiAPI, TokenResolver).
chains/evm/message/message.go Extends LifiUnlockData with BorrowToken and a repayment destination channel.
chains/evm/config.go Reads per-chain repayment processors from solver-config and normalizes symbols.
chains/evm/config_test.go Updates config tests to include/verify processors mapping.
app/app.go Wires in token resolver and constructs the unlock handler with repayer + processors + LiFi API.
api/handlers/unlock.go Accepts borrowToken and returns repaymentAddress in the unlock response.
api/handlers/unlock_test.go Updates expected response to include repaymentAddress.
Files not reviewed (1)
  • chains/evm/message/mock/unlock.go: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return nil, err
}

data.RepaymentAddressChn <- common.BytesToHash(repaymentAddress.Bytes())
Comment thread api/handlers/unlock.go
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.

Repayment to processor support

3 participants