Skip to content
Merged
1 change: 1 addition & 0 deletions packages/bridge-status-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Pass `isInternal: true` to all internal `addTransaction` / `addTransactionBatch` calls to adopt the explicit `isInternal` flag introduced in `@metamask/transaction-controller` ([#8633](https://github.com/MetaMask/core/pull/8633))
- Bump `@metamask/profile-sync-controller` from `^28.0.2` to `^28.1.0` ([#8783](https://github.com/MetaMask/core/pull/8783))
- Bump `@metamask/transaction-controller` from `^65.3.0` to `^65.4.0` ([#8796](https://github.com/MetaMask/core/pull/8796))
- Bump `@metamask/gas-fee-controller` from `^26.2.1` to `^26.2.2` ([#8834](https://github.com/MetaMask/core/pull/8834))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should delay after submitti
},
{
"actionId": "1234567891.456",
"isInternal": true,
"networkClientId": "arbitrum-client-id",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -734,6 +735,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should delay after submitti
},
{
"actionId": "1234567892.457",
"isInternal": true,
"networkClientId": "arbitrum",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -1009,6 +1011,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should delay after submitti
},
{
"actionId": "1234567891.456",
"isInternal": true,
"networkClientId": "arbitrum-client-id",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -1057,6 +1060,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should delay after submitti
},
{
"actionId": "1234567892.457",
"isInternal": true,
"networkClientId": "arbitrum",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -1251,6 +1255,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should handle smart transac
"from": "0xaccount1",
"isGasFeeIncluded": false,
"isGasFeeSponsored": false,
"isInternal": true,
"networkClientId": "arbitrum",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -1633,6 +1638,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should not call handleMobil
},
{
"actionId": "1234567891.456",
"isInternal": true,
"networkClientId": "arbitrum-client-id",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -1684,6 +1690,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should not call handleMobil
},
{
"actionId": "1234567892.457",
"isInternal": true,
"networkClientId": "arbitrum",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -1959,6 +1966,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should not call handleMobil
},
{
"actionId": "1234567891.456",
"isInternal": true,
"networkClientId": "arbitrum-client-id",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -2010,6 +2018,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should not call handleMobil
},
{
"actionId": "1234567892.457",
"isInternal": true,
"networkClientId": "arbitrum",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -2285,6 +2294,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should reset USDT allowance
},
{
"actionId": "1234567891.456",
"isInternal": true,
"networkClientId": "arbitrum-client-id",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -2336,6 +2346,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should reset USDT allowance
},
{
"actionId": "1234567892.457",
"isInternal": true,
"networkClientId": "arbitrum-client-id",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -2387,6 +2398,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should reset USDT allowance
},
{
"actionId": "1234567893.458",
"isInternal": true,
"networkClientId": "arbitrum",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -2637,6 +2649,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should successfully submit
},
{
"actionId": "1234567891.456",
"isInternal": true,
"networkClientId": "arbitrum-client-id",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -2688,6 +2701,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should successfully submit
},
{
"actionId": "1234567892.457",
"isInternal": true,
"networkClientId": "arbitrum",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -2938,6 +2952,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should successfully submit
},
{
"actionId": "1234567891.456",
"isInternal": true,
"networkClientId": "arbitrum",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -3040,6 +3055,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should throw an error if ap
},
{
"actionId": "1234567891.456",
"isInternal": true,
"networkClientId": "arbitrum-client-id",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -3168,6 +3184,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should throw an error if ap
},
{
"actionId": "1234567891.456",
"isInternal": true,
"networkClientId": "arbitrum-client-id",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -3447,6 +3464,7 @@ exports[`BridgeStatusController submitTx: EVM bridge waits for approval tx confi
},
{
"actionId": "1234567891.456",
"isInternal": true,
"networkClientId": "arbitrum-client-id",
"origin": "metamask",
"requireApproval": true,
Expand Down Expand Up @@ -3498,6 +3516,7 @@ exports[`BridgeStatusController submitTx: EVM bridge waits for approval tx confi
},
{
"actionId": "1234567892.457",
"isInternal": true,
"networkClientId": "arbitrum",
"origin": "metamask",
"requireApproval": true,
Expand Down Expand Up @@ -3644,6 +3663,7 @@ exports[`BridgeStatusController submitTx: EVM swap should gracefully handle isAt
},
{
"actionId": "1234567891.456",
"isInternal": true,
"networkClientId": "arbitrum-client-id",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -3695,6 +3715,7 @@ exports[`BridgeStatusController submitTx: EVM swap should gracefully handle isAt
},
{
"actionId": "1234567892.457",
"isInternal": true,
"networkClientId": "arbitrum",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -3975,6 +3996,7 @@ exports[`BridgeStatusController submitTx: EVM swap should handle smart transacti
"from": "0xaccount1",
"isGasFeeIncluded": false,
"isGasFeeSponsored": false,
"isInternal": true,
"networkClientId": "arbitrum",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -4230,6 +4252,7 @@ exports[`BridgeStatusController submitTx: EVM swap should successfully submit an
},
{
"actionId": "1234567891.456",
"isInternal": true,
"networkClientId": "arbitrum-client-id",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -4281,6 +4304,7 @@ exports[`BridgeStatusController submitTx: EVM swap should successfully submit an
},
{
"actionId": "1234567892.457",
"isInternal": true,
"networkClientId": "arbitrum",
"origin": "metamask",
"requireApproval": false,
Expand Down Expand Up @@ -4527,6 +4551,7 @@ exports[`BridgeStatusController submitTx: EVM swap should successfully submit an
},
{
"actionId": "1234567891.456",
"isInternal": true,
"networkClientId": "arbitrum",
"origin": "metamask",
"requireApproval": false,
Expand Down
3 changes: 3 additions & 0 deletions packages/bridge-status-controller/src/utils/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ export const addSyntheticTransaction = async (
origin: 'metamask',
actionId: generateActionId(),
isStateOnly: true,
isInternal: true,
Comment thread
matthewwalsh0 marked this conversation as resolved.
...args[1],
},
);
Expand Down Expand Up @@ -459,6 +460,7 @@ export const getAddTransactionBatchParams = async ({
networkClientId,
requireApproval,
origin: 'metamask',
isInternal: true,
from: trade.from as Hex,
transactions,
};
Expand Down Expand Up @@ -663,6 +665,7 @@ export const submitEvmTransaction = async ({
requireApproval,
type: transactionType,
origin: 'metamask',
isInternal: true,
};
// Exclude gasLimit from trade to avoid type issues (it can be null)
const { gasLimit: tradeGasLimit, ...tradeWithoutGasLimit } = trade;
Expand Down
1 change: 1 addition & 0 deletions packages/earn-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Pass `isInternal: true` to `addTransactionFn` in `executeLendingDeposit`, `executeLendingWithdraw`, and `executeLendingTokenApprove` so lending transactions bypass dapp-origin restrictions ([#8633](https://github.com/MetaMask/core/pull/8633))
- Bump `@metamask/account-tree-controller` from `^7.3.0` to `^7.4.0` ([#8783](https://github.com/MetaMask/core/pull/8783))
- Bump `@metamask/transaction-controller` from `^65.3.0` to `^65.4.0` ([#8796](https://github.com/MetaMask/core/pull/8796))

Expand Down
6 changes: 6 additions & 0 deletions packages/earn-controller/src/EarnController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2151,6 +2151,7 @@ describe('EarnController', () => {
},
{
networkClientId: '1',
isInternal: true,
},
);
});
Expand Down Expand Up @@ -2207,6 +2208,7 @@ describe('EarnController', () => {
},
{
networkClientId: '1',
isInternal: true,
},
);
});
Expand Down Expand Up @@ -2378,6 +2380,7 @@ describe('EarnController', () => {
},
{
networkClientId: '1',
isInternal: true,
},
);
});
Expand Down Expand Up @@ -2435,6 +2438,7 @@ describe('EarnController', () => {
},
{
networkClientId: '1',
isInternal: true,
},
);
});
Expand Down Expand Up @@ -2572,6 +2576,7 @@ describe('EarnController', () => {
},
{
networkClientId: '1',
isInternal: true,
},
);
});
Expand Down Expand Up @@ -2629,6 +2634,7 @@ describe('EarnController', () => {
},
{
networkClientId: '1',
isInternal: true,
},
);
});
Expand Down
3 changes: 3 additions & 0 deletions packages/earn-controller/src/EarnController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,7 @@ export class EarnController extends BaseController<
{
...txOptions,
networkClientId: selectedNetworkClientId,
isInternal: true,
},
);

Expand Down Expand Up @@ -1139,6 +1140,7 @@ export class EarnController extends BaseController<
{
...txOptions,
networkClientId: selectedNetworkClientId,
isInternal: true,
},
);

Expand Down Expand Up @@ -1216,6 +1218,7 @@ export class EarnController extends BaseController<
{
...txOptions,
networkClientId: selectedNetworkClientId,
isInternal: true,
},
);

Expand Down
4 changes: 4 additions & 0 deletions packages/perps-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]

### Changed

- Pass `isInternal: true` to all internal `addTransaction` calls to adopt the explicit `isInternal` flag introduced in `@metamask/transaction-controller` ([#8633](https://github.com/MetaMask/core/pull/8633))

## [6.1.0]

### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/perps-controller/src/PerpsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ export class PerpsController extends BaseController<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
txParams as any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
options as any,
{ ...(options as any), isInternal: true },
);
}

Expand Down
1 change: 1 addition & 0 deletions packages/transaction-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- **BREAKING:** Replace implicit `origin === 'metamask'` trust checks with an explicit `isInternal` flag on `AddTransactionOptions`, `TransactionBatchRequest`, `TransactionMeta`, and `TransactionBatchMeta`; internal callers must now pass `isInternal: true` ([#8633](https://github.com/MetaMask/core/pull/8633))
- Bump `@metamask/core-backend` from `^6.2.2` to `^6.3.0` ([#8813](https://github.com/MetaMask/core/pull/8813))
- Bump `@metamask/gas-fee-controller` from `^26.2.1` to `^26.2.2` ([#8834](https://github.com/MetaMask/core/pull/8834))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@ describe('TransactionController', () => {

await controller.addTransaction(
{ from: ACCOUNT_MOCK, to: ACCOUNT_MOCK, ...extraTxParamsToSet },
{ networkClientId: NETWORK_CLIENT_ID_MOCK },
{ isInternal: true, networkClientId: NETWORK_CLIENT_ID_MOCK },
);

expect(controller.state.transactions[0].txParams.type).toBe(type);
Expand Down Expand Up @@ -3714,7 +3714,7 @@ describe('TransactionController', () => {
).rejects.toThrow('Batch ID already exists');
});

it('does not throw if duplicate but internal origin', async () => {
it('does not throw if duplicate but isInternal', async () => {
const { controller } = setupController({
options: {
state: {
Expand All @@ -3735,6 +3735,7 @@ describe('TransactionController', () => {

await controller.addTransaction(txParams, {
batchId: BATCH_ID_MOCK,
isInternal: true,
networkClientId: NETWORK_CLIENT_ID_MOCK,
});
});
Expand Down
Loading
Loading