Skip to content

Commit

Permalink
Merge pull request #24395 from MetaMask/Version-v11.15.3
Browse files Browse the repository at this point in the history
Version v11.15.3
  • Loading branch information
danjm committed May 7, 2024
2 parents 6327468 + dea4bc0 commit fbd28c8
Show file tree
Hide file tree
Showing 27 changed files with 754 additions and 581 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Expand Up @@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [11.15.3]
### Changed
- Smart transaction improvements ([#24340](https://github.com/MetaMask/metamask-extension/pull/24340))
- disable Smart Transactions on Sepolia
- improve Smart Transaction status page layout on full screen view
- Conditionally close the extension when a user clicks on "View transaction" on the Smart Transaction status page
- Update animation UI for non-popup view of Smart Transactions

### Fixed
- Add animation on the smart transaction status page ([#24389](https://github.com/MetaMask/metamask-extension/pull/24389))

## [11.15.2]
### Fixed
- Ensure smart transaction modal is shown for users upgrading from previous versions ([#24377](https://github.com/MetaMask/metamask-extension/pull/24377))
Expand Down Expand Up @@ -4677,7 +4688,8 @@ Update styles and spacing on the critical error page ([#20350](https://github.c
- Added the ability to restore accounts from seed words.


[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v11.15.2...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v11.15.3...HEAD
[11.15.3]: https://github.com/MetaMask/metamask-extension/compare/v11.15.2...v11.15.3
[11.15.2]: https://github.com/MetaMask/metamask-extension/compare/v11.15.1...v11.15.2
[11.15.1]: https://github.com/MetaMask/metamask-extension/compare/v11.15.0...v11.15.1
[11.15.0]: https://github.com/MetaMask/metamask-extension/compare/v11.14.5...v11.15.0
Expand Down
2 changes: 1 addition & 1 deletion app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions app/scripts/lib/notification-manager.js
@@ -1,8 +1,9 @@
import EventEmitter from '@metamask/safe-event-emitter';
import ExtensionPlatform from '../platforms/extension';

const NOTIFICATION_HEIGHT = 620;
const NOTIFICATION_WIDTH = 360;
import {
NOTIFICATION_HEIGHT,
NOTIFICATION_WIDTH,
} from '../../../shared/constants/notifications';

export const NOTIFICATION_MANAGER_EVENTS = {
POPUP_CLOSED: 'onPopupClosed',
Expand Down
17 changes: 17 additions & 0 deletions app/scripts/lib/transaction/smart-transactions.test.ts
Expand Up @@ -134,6 +134,23 @@ describe('submitSmartTransactionHook', () => {
expect(result).toEqual({ transactionHash: undefined });
});

it('falls back to regular transaction submit if /getFees throws an error', async () => {
const request: SubmitSmartTransactionRequestMocked = createRequest();
jest
.spyOn(request.smartTransactionsController, 'getFees')
.mockImplementation(() => {
throw new Error('Backend call to /getFees failed');
});
const result = await submitSmartTransactionHook(request);
expect(request.controllerMessenger.call).toHaveBeenCalledWith(
'ApprovalController:endFlow',
{
id: 'approvalId',
},
);
expect(result).toEqual({ transactionHash: undefined });
});

it('returns a txHash asap if the feature flag requires it', async () => {
const request: SubmitSmartTransactionRequestMocked = createRequest();
request.featureFlags.smartTransactions.returnTxHashAsap = true;
Expand Down
12 changes: 11 additions & 1 deletion app/scripts/lib/transaction/smart-transactions.ts
Expand Up @@ -129,11 +129,21 @@ class SmartTransactionHook {
'ApprovalController:startFlow',
);
this.#approvalFlowId = approvalFlowId;
let getFeesResponse;
try {
const getFeesResponse = await this.#smartTransactionsController.getFees(
getFeesResponse = await this.#smartTransactionsController.getFees(
{ ...this.#txParams, chainId: this.#chainId },
undefined,
);
} catch (error) {
log.error(
'Error in smart transaction publish hook, falling back to regular transaction submission',
error,
);
this.#onApproveOrReject();
return useRegularTransactionSubmit; // Fallback to regular transaction submission.
}
try {
const submitTransactionResponse = await this.#signAndSubmitTransactions({
getFeesResponse,
});
Expand Down
11 changes: 8 additions & 3 deletions app/scripts/metamask-controller.js
Expand Up @@ -171,7 +171,8 @@ import {
TEST_NETWORK_TICKER_MAP,
NetworkStatus,
} from '../../shared/constants/network';
import { ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS } from '../../shared/constants/smartTransactions';
import { getAllowedSmartTransactionsChainIds } from '../../shared/constants/smartTransactions';

import {
HardwareDeviceNames,
LedgerTransportTypes,
Expand Down Expand Up @@ -1847,7 +1848,7 @@ export default class MetamaskController extends EventEmitter {
),
},
{
supportedChainIds: ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS,
supportedChainIds: getAllowedSmartTransactionsChainIds(),
},
initState.SmartTransactionsController,
);
Expand Down Expand Up @@ -4283,7 +4284,11 @@ export default class MetamaskController extends EventEmitter {
async resetAccount() {
const selectedAddress =
this.accountsController.getSelectedAccount().address;
this.txController.wipeTransactions(true, selectedAddress);
this.txController.wipeTransactions(false, selectedAddress);
this.smartTransactionsController.wipeSmartTransactions({
address: selectedAddress,
ignoreNetwork: false,
});
this.networkController.resetConnection();

return selectedAddress;
Expand Down
15 changes: 14 additions & 1 deletion app/scripts/metamask-controller.test.js
Expand Up @@ -1033,15 +1033,28 @@ describe('MetaMaskController', () => {
.mockReturnValue({ address: selectedAddressMock });

jest.spyOn(metamaskController.txController, 'wipeTransactions');
jest.spyOn(
metamaskController.smartTransactionsController,
'wipeSmartTransactions',
);

await metamaskController.resetAccount();

expect(
metamaskController.txController.wipeTransactions,
).toHaveBeenCalledTimes(1);
expect(
metamaskController.smartTransactionsController.wipeSmartTransactions,
).toHaveBeenCalledTimes(1);
expect(
metamaskController.txController.wipeTransactions,
).toHaveBeenCalledWith(true, selectedAddressMock);
).toHaveBeenCalledWith(false, selectedAddressMock);
expect(
metamaskController.smartTransactionsController.wipeSmartTransactions,
).toHaveBeenCalledWith({
address: selectedAddressMock,
ignoreNetwork: false,
});
});
});

Expand Down

0 comments on commit fbd28c8

Please sign in to comment.