feat: allow processor to be unlock destination#188
Open
mpetrun5 wants to merge 3 commits into
Open
Conversation
|
Go Test coverage is 36.7 %\ ✨ ✨ ✨ |
mpetrunic
approved these changes
May 14, 2026
There was a problem hiding this comment.
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
borrowTokento unlock requests and return the computedrepaymentAddressin the API response. - Update
LifiUnlockHandlerto 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()) |
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.
Description
Related Issue Or Context
Closes: #181
How Has This Been Tested? Testing details.
Types of changes
Checklist: