Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/transaction-pay-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Resolve correct `networkClientId` for source chain in Relay execute flow ([#8492](https://github.com/MetaMask/core/pull/8492))

## [19.2.0]

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,7 @@ describe('Relay Submit Utils', () => {
expect(getDelegationTransactionMock).toHaveBeenCalledWith({
transaction: expect.objectContaining({
chainId: CHAIN_ID_MOCK,
networkClientId: NETWORK_CLIENT_ID_MOCK,
nestedTransactions: [
{
data: '0x1234',
Expand All @@ -1283,6 +1284,14 @@ describe('Relay Submit Utils', () => {
});
});

it('resolves networkClientId for source chain instead of inheriting from original transaction', async () => {
await submitRelayQuotes(request);

expect(findNetworkClientIdByChainIdMock).toHaveBeenCalledWith(
CHAIN_ID_MOCK,
);
});

it('submits to /execute with delegation data', async () => {
await submitRelayQuotes(request);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,15 @@ async function submitViaRelayExecute(
const { from, sourceChainId } = quote.request;
const { requestId } = quote.original.steps[0];

const networkClientId = messenger.call(
'NetworkController:findNetworkClientIdByChainId',
sourceChainId,
);

const sourceCallTransaction = {
...transaction,
chainId: sourceChainId,
networkClientId,
nestedTransactions: allParams.map((params) => ({
data: (params.data ?? '0x') as Hex,
to: params.to as Hex,
Expand Down
Loading