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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- **BREAKING:** Disallow subpath exports ([#469](https://github.com/MetaMask/smart-transactions-controller/pull/469))
- Update `@metamask/base-controller` from `^7.0.1` to `^8.3.0` ([#529](https://github.com/MetaMask/smart-transactions-controller/pull/529))
- Update `@metamask/polling-controller` from `^12.0.0` to `^14.0.0` ([#529](https://github.com/MetaMask/smart-transactions-controller/pull/529))

## [18.1.0]

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/keccak256": "^5.8.0",
"@ethersproject/transactions": "^5.7.0",
"@metamask/base-controller": "^7.0.1",
"@metamask/base-controller": "^8.3.0",
"@metamask/controller-utils": "^11.0.0",
"@metamask/eth-json-rpc-provider": "^4.1.6",
"@metamask/eth-query": "^4.0.0",
"@metamask/polling-controller": "^12.0.0",
"@metamask/polling-controller": "^14.0.0",
"bignumber.js": "^9.0.1",
"fast-json-patch": "^3.1.0",
"lodash": "^4.17.21"
Expand Down
4 changes: 2 additions & 2 deletions src/SmartTransactionsController.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ControllerMessenger } from '@metamask/base-controller';
import { Messenger } from '@metamask/base-controller';
import {
NetworkType,
convertHexToDecimal,
Expand Down Expand Up @@ -446,7 +446,7 @@

controller.timeoutHandle = setTimeout(() => ({}));

controller.poll(1000);

Check warning on line 449 in src/SmartTransactionsController.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 449 in src/SmartTransactionsController.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

expect(updateSmartTransactionsSpy).toHaveBeenCalled();
});
Expand Down Expand Up @@ -2565,7 +2565,7 @@
): Promise<ReturnValue> {
const [{ ...rest }, fn] = args.length === 2 ? args : [{}, args[0]];
const { options } = rest;
const controllerMessenger = new ControllerMessenger<
const controllerMessenger = new Messenger<
| SmartTransactionsControllerActions
| NetworkControllerGetNetworkClientByIdAction
| NetworkControllerGetStateAction,
Expand Down Expand Up @@ -2703,7 +2703,7 @@
triggerNetworStateChange,
});
} finally {
controller.stop();

Check warning on line 2706 in src/SmartTransactionsController.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 2706 in src/SmartTransactionsController.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
controller.stopAllPolling();
}
}
17 changes: 8 additions & 9 deletions src/SmartTransactionsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type {
ControllerGetStateAction,
ControllerStateChangeEvent,
RestrictedControllerMessenger,
RestrictedMessenger,
} from '@metamask/base-controller';
import {
query,
Expand Down Expand Up @@ -178,14 +178,13 @@
/**
* The messenger of the {@link SmartTransactionsController}.
*/
export type SmartTransactionsControllerMessenger =
RestrictedControllerMessenger<
typeof controllerName,
SmartTransactionsControllerActions | AllowedActions,
SmartTransactionsControllerEvents | AllowedEvents,
AllowedActions['type'],
AllowedEvents['type']
>;
export type SmartTransactionsControllerMessenger = RestrictedMessenger<
typeof controllerName,
SmartTransactionsControllerActions | AllowedActions,
SmartTransactionsControllerEvents | AllowedEvents,
AllowedActions['type'],
AllowedEvents['type']
>;

type SmartTransactionsControllerOptions = {
interval?: number;
Expand Down Expand Up @@ -358,9 +357,9 @@
isSmartTransactionPending,
);
if (!this.timeoutHandle && pendingTransactions?.length > 0) {
this.poll();

Check warning on line 360 in src/SmartTransactionsController.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 360 in src/SmartTransactionsController.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
} else if (this.timeoutHandle && pendingTransactions?.length === 0) {
this.stop();

Check warning on line 362 in src/SmartTransactionsController.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 362 in src/SmartTransactionsController.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
}
}

Expand All @@ -385,7 +384,7 @@
}

this.timeoutHandle = setInterval(() => {
safelyExecute(async () => this.updateSmartTransactions());

Check warning on line 387 in src/SmartTransactionsController.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 387 in src/SmartTransactionsController.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
}, this.#interval);
await safelyExecute(async () => this.updateSmartTransactions());
}
Expand Down Expand Up @@ -452,7 +451,7 @@
ethQuery = new EthQuery(provider);
}

this.#createOrUpdateSmartTransaction(smartTransaction, {

Check warning on line 454 in src/SmartTransactionsController.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 454 in src/SmartTransactionsController.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
chainId,
ethQuery,
});
Expand Down Expand Up @@ -739,7 +738,7 @@
: originalTxMeta;

if (this.#doesTransactionNeedConfirmation(txHash)) {
this.#confirmExternalTransaction(

Check warning on line 741 in src/SmartTransactionsController.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 741 in src/SmartTransactionsController.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
// TODO: Replace 'as' assertion with correct typing for `txMeta`
txMeta as TransactionMeta,
transactionReceipt,
Expand Down
4 changes: 2 additions & 2 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ControllerMessenger } from '@metamask/base-controller';
import { Messenger } from '@metamask/base-controller';
import {
type NetworkControllerGetNetworkClientByIdAction,
type NetworkControllerGetStateAction,
Expand All @@ -15,7 +15,7 @@ import { ClientId } from './types';
describe('default export', () => {
it('exports SmartTransactionsController', () => {
jest.useFakeTimers();
const controllerMessenger = new ControllerMessenger<
const controllerMessenger = new Messenger<
| SmartTransactionsControllerActions
| NetworkControllerGetNetworkClientByIdAction
| NetworkControllerGetStateAction,
Expand Down
Loading
Loading