Skip to content

Commit

Permalink
deps: nonce-tracker@^3.0.0 -> @metamask/nonce-tracker@^5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed May 28, 2024
1 parent 7f2ceac commit deca5ec
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/transaction-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@
"@metamask/gas-fee-controller": "^15.1.2",
"@metamask/metamask-eth-abis": "^3.1.1",
"@metamask/network-controller": "^18.1.1",
"@metamask/nonce-tracker": "^5.0.0",
"@metamask/rpc-errors": "^6.2.1",
"@metamask/utils": "^8.3.0",
"async-mutex": "^0.2.6",
"bn.js": "^5.2.1",
"eth-method-registry": "^4.0.0",
"fast-json-patch": "^3.1.1",
"lodash": "^4.17.21",
"nonce-tracker": "^3.0.0",
"uuid": "^8.3.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import type {
Provider,
} from '@metamask/network-controller';
import { NetworkClientType, NetworkStatus } from '@metamask/network-controller';
import * as NonceTrackerPackage from '@metamask/nonce-tracker';
import { errorCodes, providerErrors, rpcErrors } from '@metamask/rpc-errors';
import { createDeferredPromise } from '@metamask/utils';
import assert from 'assert';
import * as NonceTrackerPackage from 'nonce-tracker';
import * as uuidModule from 'uuid';

import { FakeBlockTracker } from '../../../tests/fake-block-tracker';
Expand Down
13 changes: 7 additions & 6 deletions packages/transaction-controller/src/TransactionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ import type {
NetworkControllerGetNetworkClientByIdAction,
} from '@metamask/network-controller';
import { NetworkClientType } from '@metamask/network-controller';
import { NonceTracker } from '@metamask/nonce-tracker';
import type {
NonceLock,
Transaction as NonceTrackerTransaction,
} from '@metamask/nonce-tracker';
import { errorCodes, rpcErrors, providerErrors } from '@metamask/rpc-errors';
import type { Hex } from '@metamask/utils';
import { add0x } from '@metamask/utils';
import { Mutex } from 'async-mutex';
import { MethodRegistry } from 'eth-method-registry';
import { EventEmitter } from 'events';
import { cloneDeep, mapValues, merge, pickBy, sortBy, isEqual } from 'lodash';
import { NonceTracker } from 'nonce-tracker';
import type {
NonceLock,
Transaction as NonceTrackerTransaction,
} from 'nonce-tracker';
import { v1 as random } from 'uuid';

import { DefaultGasFeeFlow } from './gas-flows/DefaultGasFeeFlow';
Expand Down Expand Up @@ -3402,9 +3402,10 @@ export class TransactionController extends BaseController<
chainId?: Hex;
}): NonceTracker {
return new NonceTracker({
// TODO: Replace `any` with type
// TODO: Fix types
// eslint-disable-next-line @typescript-eslint/no-explicit-any
provider: provider as any,
// @ts-expect-error TODO: Fix types
blockTracker,
getPendingTransactions: this.#getNonceTrackerPendingTransactions.bind(
this,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable jsdoc/require-jsdoc */
import { ChainId } from '@metamask/controller-utils';
import type { NetworkClientId, Provider } from '@metamask/network-controller';
import type { NonceTracker } from '@metamask/nonce-tracker';
import type { Hex } from '@metamask/utils';
import type { NonceTracker } from 'nonce-tracker';
import { useFakeTimers } from 'sinon';

import { advanceTime } from '../../../../tests/helpers';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import type {
Provider,
NetworkControllerStateChangeEvent,
} from '@metamask/network-controller';
import type { NonceLock, NonceTracker } from '@metamask/nonce-tracker';
import type { Hex } from '@metamask/utils';
import { Mutex } from 'async-mutex';
import type { NonceLock, NonceTracker } from 'nonce-tracker';

import { incomingTransactionsLogger as log } from '../logger';
import { EtherscanRemoteTransactionSource } from './EtherscanRemoteTransactionSource';
Expand Down
2 changes: 1 addition & 1 deletion packages/transaction-controller/src/utils/nonce.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {
NonceLock,
Transaction as NonceTrackerTransaction,
} from 'nonce-tracker';
} from '@metamask/nonce-tracker';

import type { TransactionMeta } from '../types';
import { TransactionStatus } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion packages/transaction-controller/src/utils/nonce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { toHex } from '@metamask/controller-utils';
import type {
NonceLock,
Transaction as NonceTrackerTransaction,
} from 'nonce-tracker';
} from '@metamask/nonce-tracker';

import { createModuleLogger, projectLogger } from '../logger';
import type { TransactionMeta, TransactionStatus } from '../types';
Expand Down
24 changes: 13 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2555,6 +2555,18 @@ __metadata:
languageName: unknown
linkType: soft

"@metamask/nonce-tracker@npm:^5.0.0":
version: 5.0.0
resolution: "@metamask/nonce-tracker@npm:5.0.0"
dependencies:
"@ethersproject/providers": ^5.7.2
async-mutex: ^0.3.1
peerDependencies:
"@metamask/eth-block-tracker": ">=9"
checksum: 31de9d62f2aec52688a4b7ec1fab877d1f2f4e6b2b395abef2790ddee63b3511f312c07c29d1c191f900231dbd4cdde8e969b210462f78253a177cacee72688c
languageName: node
linkType: hard

"@metamask/notification-controller@workspace:packages/notification-controller":
version: 0.0.0-use.local
resolution: "@metamask/notification-controller@workspace:packages/notification-controller"
Expand Down Expand Up @@ -3044,6 +3056,7 @@ __metadata:
"@metamask/gas-fee-controller": ^15.1.2
"@metamask/metamask-eth-abis": ^3.1.1
"@metamask/network-controller": ^18.1.1
"@metamask/nonce-tracker": ^5.0.0
"@metamask/rpc-errors": ^6.2.1
"@metamask/utils": ^8.3.0
"@types/bn.js": ^5.1.5
Expand All @@ -3058,7 +3071,6 @@ __metadata:
jest: ^27.5.1
lodash: ^4.17.21
nock: ^13.3.1
nonce-tracker: ^3.0.0
sinon: ^9.2.4
ts-jest: ^27.1.4
typedoc: ^0.24.8
Expand Down Expand Up @@ -9422,16 +9434,6 @@ __metadata:
languageName: node
linkType: hard

"nonce-tracker@npm:^3.0.0":
version: 3.0.0
resolution: "nonce-tracker@npm:3.0.0"
dependencies:
"@ethersproject/providers": ^5.7.2
async-mutex: ^0.3.1
checksum: f679e83359c3d0b1941cb8569057445b5430b7e5645216442c256b2061ffb08ebee07e15011d3d55acf75710e054abd924c1b1bb38847956ef9f3bb7eed622d4
languageName: node
linkType: hard

"nopt@npm:^7.0.0":
version: 7.2.0
resolution: "nopt@npm:7.2.0"
Expand Down

0 comments on commit deca5ec

Please sign in to comment.