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
1 change: 1 addition & 0 deletions packages/transaction-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Include Mantle operator fee in the displayed L1 gas estimate when simulated `gasUsed` is unavailable, by falling back to the transaction's gas limit ([#8837](https://github.com/MetaMask/core/pull/8837))
- Adds a `protected getOperatorFeeGas` hook on `OracleLayer1GasFeeFlow` that subclasses can override to supply a fallback value. The default behaviour is unchanged (returns `transactionMeta.gasUsed`).
- `MantleLayer1GasFeeFlow` overrides the hook with `gasUsed ?? txParams.gas ?? txParams.gasLimit`, so the operator-fee oracle is called with the gas limit when `gasUsed` is missing. Gas limit is an upper bound on actual gas used, so the operator fee is over-estimated rather than under-reported.
- Fix `ExtraTransactionsPublishHook` not passing `isInternal: true` when calling `addTransactionBatch`, causing the duplicate-batch-ID guard to incorrectly throw `DuplicateBundleId` (error 5720) for nested ERC-20 gas-fee-token transfers that share a `batchId` with their parent batch ([#8884](https://github.com/MetaMask/core/pull/8884))

## [66.0.0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3739,6 +3739,36 @@ describe('TransactionController', () => {
networkClientId: NETWORK_CLIENT_ID_MOCK,
});
});

it('does not throw if duplicate and isInternal is true', async () => {
const { controller } = setupController({
options: {
state: {
transactions: [
{
batchId: BATCH_ID_MOCK,
} as unknown as TransactionMeta,
],
},
},
updateToInitialState: true,
});

const txParams = {
from: ACCOUNT_MOCK,
to: ACCOUNT_MOCK,
};

const { result } = await controller.addTransaction(txParams, {
batchId: BATCH_ID_MOCK,
isInternal: true,
networkClientId: NETWORK_CLIENT_ID_MOCK,
origin: ORIGIN_MOCK,
requireApproval: false,
});

await result.catch(() => undefined);
});
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ describe('ExtraTransactionsPublishHook', () => {
disable7702: true,
disableHook: false,
disableSequential: true,
isInternal: true,
requireApproval: false,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export class ExtraTransactionsPublishHook {

await this.#addTransactionBatch({
from,
isInternal: true,
networkClientId,
requireApproval: false,
transactions,
Expand Down
Loading