Skip to content

Commit 34497f6

Browse files
build(deps): bump @metamask/{base, polling}-controller (#448)
* build(deps): bump @metamask/polling-controller from 8.0.0 to 11.0.0 Bumps [@metamask/polling-controller](https://github.com/MetaMask/core) from 8.0.0 to 11.0.0. - [Release notes](https://github.com/MetaMask/core/releases) - [Changelog](https://github.com/MetaMask/core/blob/main/docs/reviewing-release-prs.md) - [Commits](https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]) --- updated-dependencies: - dependency-name: "@metamask/polling-controller" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * feat: add `SmartTransactionsControllerPollingInput` * update `@metamask/base-controller` to `^7.0.1` * test: `startPollingByNetworkId` is now `startPolling` --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michele Esposito <[email protected]>
1 parent af040b3 commit 34497f6

File tree

4 files changed

+33
-11
lines changed

4 files changed

+33
-11
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
"@ethereumjs/tx": "^5.2.1",
3030
"@ethereumjs/util": "^9.0.2",
3131
"@ethersproject/bytes": "^5.7.0",
32-
"@metamask/base-controller": "^6.0.0",
32+
"@metamask/base-controller": "^7.0.1",
3333
"@metamask/controller-utils": "^11.0.0",
3434
"@metamask/eth-json-rpc-provider": "^4.1.0",
3535
"@metamask/eth-query": "^4.0.0",
3636
"@metamask/network-controller": "^21.1.0",
37-
"@metamask/polling-controller": "^8.0.0",
37+
"@metamask/polling-controller": "^11.0.0",
3838
"@metamask/transaction-controller": "^34.0.0",
3939
"bignumber.js": "^9.0.1",
4040
"events": "^3.3.0",

src/SmartTransactionsController.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ describe('SmartTransactionsController', () => {
13831383
});
13841384
});
13851385

1386-
describe('startPollingByNetworkClientId', () => {
1386+
describe('startPolling', () => {
13871387
let clock: sinon.SinonFakeTimers;
13881388

13891389
beforeEach(() => {
@@ -1431,9 +1431,9 @@ describe('SmartTransactionsController', () => {
14311431
},
14321432
async ({ controller }) => {
14331433
const handleFetchSpy = jest.spyOn(utils, 'handleFetch');
1434-
const mainnetPollingToken = controller.startPollingByNetworkClientId(
1435-
NetworkType.mainnet,
1436-
);
1434+
const mainnetPollingToken = controller.startPolling({
1435+
networkClientId: NetworkType.mainnet,
1436+
});
14371437

14381438
await advanceTime({ clock, duration: 0 });
14391439

@@ -1462,7 +1462,7 @@ describe('SmartTransactionsController', () => {
14621462
fetchHeaders,
14631463
);
14641464

1465-
controller.startPollingByNetworkClientId(NetworkType.sepolia);
1465+
controller.startPolling({ networkClientId: NetworkType.sepolia });
14661466
await advanceTime({ clock, duration: 0 });
14671467

14681468
expect(handleFetchSpy).toHaveBeenNthCalledWith(

src/SmartTransactionsController.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ type SmartTransactionsControllerOptions = {
200200
getMetaMetricsProps: () => Promise<MetaMetricsProps>;
201201
};
202202

203-
export default class SmartTransactionsController extends StaticIntervalPollingController<
203+
export type SmartTransactionsControllerPollingInput = {
204+
networkClientId: string;
205+
};
206+
207+
export default class SmartTransactionsController extends StaticIntervalPollingController<SmartTransactionsControllerPollingInput>()<
204208
typeof controllerName,
205209
SmartTransactionsControllerState,
206210
SmartTransactionsControllerMessenger
@@ -301,7 +305,9 @@ export default class SmartTransactionsController extends StaticIntervalPollingCo
301305
);
302306
}
303307

304-
async _executePoll(networkClientId: string): Promise<void> {
308+
async _executePoll({
309+
networkClientId,
310+
}: SmartTransactionsControllerPollingInput): Promise<void> {
305311
// if this is going to be truly UI driven polling we shouldn't really reach here
306312
// with a networkClientId that is not supported, but for now I'll add a check in case
307313
// wondering if we should add some kind of predicate to the polling controller to check whether

yarn.lock

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,6 +2090,22 @@ __metadata:
20902090
languageName: node
20912091
linkType: hard
20922092

2093+
"@metamask/polling-controller@npm:^11.0.0":
2094+
version: 11.0.0
2095+
resolution: "@metamask/polling-controller@npm:11.0.0"
2096+
dependencies:
2097+
"@metamask/base-controller": ^7.0.1
2098+
"@metamask/controller-utils": ^11.3.0
2099+
"@metamask/utils": ^9.1.0
2100+
"@types/uuid": ^8.3.0
2101+
fast-json-stable-stringify: ^2.1.0
2102+
uuid: ^8.3.2
2103+
peerDependencies:
2104+
"@metamask/network-controller": ^21.0.0
2105+
checksum: 52a8f72a9ef3633d0a3dae2c148923f14462c6bc3058ebb93d3b6288b4faa56d7b62396038fdb855053f711c1f9b214a572c1bb7bf3e9e1613c55bbeace69966
2106+
languageName: node
2107+
linkType: hard
2108+
20932109
"@metamask/polling-controller@npm:^8.0.0":
20942110
version: 8.0.0
20952111
resolution: "@metamask/polling-controller@npm:8.0.0"
@@ -2213,7 +2229,7 @@ __metadata:
22132229
"@ethersproject/bytes": ^5.7.0
22142230
"@lavamoat/allow-scripts": ^2.3.1
22152231
"@metamask/auto-changelog": ^3.1.0
2216-
"@metamask/base-controller": ^6.0.0
2232+
"@metamask/base-controller": ^7.0.1
22172233
"@metamask/controller-utils": ^11.0.0
22182234
"@metamask/eslint-config": ^12.2.0
22192235
"@metamask/eslint-config-jest": ^12.1.0
@@ -2223,7 +2239,7 @@ __metadata:
22232239
"@metamask/eth-query": ^4.0.0
22242240
"@metamask/json-rpc-engine": ^9.0.0
22252241
"@metamask/network-controller": ^21.1.0
2226-
"@metamask/polling-controller": ^8.0.0
2242+
"@metamask/polling-controller": ^11.0.0
22272243
"@metamask/transaction-controller": ^34.0.0
22282244
"@types/jest": ^26.0.24
22292245
"@types/lodash": ^4.14.194

0 commit comments

Comments
 (0)