Skip to content

Commit 04c88cf

Browse files
mikespositolegobeat
authored andcommitted
Update @ethereumjs/tx and @ethereumjs/common (#1514)
* chore: update @ethereumjs/tx and @ethereumjs/common * chore: update @metamask/utils * yarn dedupe --------- Co-authored-by: legobt <6wbvkn0j@anonaddy.me>
1 parent 0107b5c commit 04c88cf

File tree

18 files changed

+124
-165
lines changed

18 files changed

+124
-165
lines changed

packages/address-book-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"dependencies": {
3232
"@metamask/base-controller": "workspace:^",
3333
"@metamask/controller-utils": "workspace:^",
34-
"@metamask/utils": "^5.0.2"
34+
"@metamask/utils": "^6.2.0"
3535
},
3636
"devDependencies": {
3737
"@metamask/auto-changelog": "^3.1.0",

packages/approval-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"dependencies": {
3232
"@metamask/base-controller": "workspace:^",
33-
"@metamask/utils": "^5.0.2",
33+
"@metamask/utils": "^6.2.0",
3434
"eth-rpc-errors": "^4.0.2",
3535
"immer": "^9.0.6",
3636
"nanoid": "^3.1.31"

packages/assets-controllers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@metamask/network-controller": "workspace:^",
4343
"@metamask/preferences-controller": "workspace:^",
4444
"@metamask/rpc-errors": "^5.1.1",
45-
"@metamask/utils": "^5.0.2",
45+
"@metamask/utils": "^6.2.0",
4646
"@types/uuid": "^8.3.0",
4747
"abort-controller": "^3.0.0",
4848
"async-mutex": "^0.2.6",

packages/base-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"test:watch": "jest --watch"
3030
},
3131
"dependencies": {
32-
"@metamask/utils": "^5.0.2",
32+
"@metamask/utils": "^6.2.0",
3333
"immer": "^9.0.6"
3434
},
3535
"devDependencies": {

packages/controller-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"test:watch": "jest --watch"
3030
},
3131
"dependencies": {
32-
"@metamask/utils": "^5.0.2",
32+
"@metamask/utils": "^6.2.0",
3333
"@spruceid/siwe-parser": "1.1.3",
3434
"eth-ens-namehash": "^2.0.8",
3535
"eth-query": "^2.1.2",

packages/ens-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@metamask/base-controller": "workspace:^",
3434
"@metamask/controller-utils": "workspace:^",
3535
"@metamask/network-controller": "workspace:^",
36-
"@metamask/utils": "^5.0.2",
36+
"@metamask/utils": "^6.2.0",
3737
"ethereum-ens-network-map": "^1.0.2",
3838
"punycode": "^2.1.1"
3939
},

packages/gas-fee-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@metamask/base-controller": "workspace:^",
3333
"@metamask/controller-utils": "workspace:^",
3434
"@metamask/network-controller": "workspace:^",
35-
"@metamask/utils": "^5.0.2",
35+
"@metamask/utils": "^6.2.0",
3636
"@types/uuid": "^8.3.0",
3737
"eth-query": "^2.1.2",
3838
"ethereumjs-util": "^7.0.10",

packages/keyring-controller/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"test:watch": "jest --watch"
3030
},
3131
"dependencies": {
32-
"@keystonehq/metamask-airgapped-keyring": "^0.6.1",
32+
"@keystonehq/metamask-airgapped-keyring": "^0.13.1",
3333
"@metamask/base-controller": "workspace:^",
3434
"@metamask/controller-utils": "workspace:^",
3535
"@metamask/eth-keyring-controller": "^10.0.1",
@@ -42,8 +42,8 @@
4242
"immer": "^9.0.6"
4343
},
4444
"devDependencies": {
45-
"@ethereumjs/common": "^2.6.1",
46-
"@ethereumjs/tx": "^3.5.2",
45+
"@ethereumjs/common": "^3.2.0",
46+
"@ethereumjs/tx": "^4.2.0",
4747
"@keystonehq/bc-ur-registry-eth": "^0.9.0",
4848
"@metamask/auto-changelog": "^3.1.0",
4949
"@metamask/scure-bip39": "^2.1.0",

packages/keyring-controller/src/KeyringController.test.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import Common from '@ethereumjs/common';
1+
import { Common } from '@ethereumjs/common';
22
import { TransactionFactory } from '@ethereumjs/tx';
33
import { CryptoHDKey, ETHSignature } from '@keystonehq/bc-ur-registry-eth';
44
import { MetaMaskKeyring as QRKeyring } from '@keystonehq/metamask-airgapped-keyring';
55
import { ControllerMessenger } from '@metamask/base-controller';
6-
import { isValidHexAddress, NetworkType } from '@metamask/controller-utils';
6+
import { isValidHexAddress } from '@metamask/controller-utils';
77
import { keyringBuilderFactory } from '@metamask/eth-keyring-controller';
88
import {
99
normalize,
@@ -1457,15 +1457,12 @@ describe('KeyringController', () => {
14571457
type: 2,
14581458
},
14591459
{
1460-
common: Common.forCustomChain(
1461-
NetworkType.mainnet,
1462-
{
1463-
name: 'goerli',
1464-
chainId: parseInt('5'),
1465-
networkId: parseInt('5'),
1466-
},
1467-
'london',
1468-
),
1460+
common: Common.custom({
1461+
name: 'goerli',
1462+
chainId: parseInt('5'),
1463+
networkId: parseInt('5'),
1464+
defaultHardfork: 'london',
1465+
}),
14691466
},
14701467
);
14711468
const signedTx = await signProcessKeyringController.signTransaction(

packages/message-manager/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@metamask/base-controller": "workspace:^",
3333
"@metamask/controller-utils": "workspace:^",
3434
"@metamask/eth-sig-util": "^6.0.0",
35-
"@metamask/utils": "^5.0.2",
35+
"@metamask/utils": "^6.2.0",
3636
"@types/uuid": "^8.3.0",
3737
"ethereumjs-util": "^7.0.10",
3838
"jsonschema": "^1.2.4",

packages/network-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@metamask/eth-json-rpc-middleware": "^11.0.0",
3636
"@metamask/eth-json-rpc-provider": "^1.0.0",
3737
"@metamask/swappable-obj-proxy": "^2.1.0",
38-
"@metamask/utils": "^5.0.2",
38+
"@metamask/utils": "^6.2.0",
3939
"async-mutex": "^0.2.6",
4040
"eth-block-tracker": "^7.0.1",
4141
"eth-query": "^2.1.2",

packages/notification-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"dependencies": {
3232
"@metamask/base-controller": "workspace:^",
33-
"@metamask/utils": "^5.0.2",
33+
"@metamask/utils": "^6.2.0",
3434
"immer": "^9.0.6",
3535
"nanoid": "^3.1.31"
3636
},

packages/permission-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@metamask/approval-controller": "workspace:^",
3333
"@metamask/base-controller": "workspace:^",
3434
"@metamask/controller-utils": "workspace:^",
35-
"@metamask/utils": "^5.0.2",
35+
"@metamask/utils": "^6.2.0",
3636
"@types/deep-freeze-strict": "^1.1.0",
3737
"deep-freeze-strict": "^1.1.1",
3838
"eth-rpc-errors": "^4.0.2",

packages/signature-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@metamask/base-controller": "workspace:^",
3434
"@metamask/controller-utils": "workspace:^",
3535
"@metamask/message-manager": "workspace:^",
36-
"@metamask/utils": "^5.0.2",
36+
"@metamask/utils": "^6.2.0",
3737
"eth-rpc-errors": "^4.0.2",
3838
"ethereumjs-util": "^7.0.10",
3939
"immer": "^9.0.6",

packages/transaction-controller/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
"test:watch": "jest --watch"
3030
},
3131
"dependencies": {
32-
"@ethereumjs/common": "^2.6.1",
33-
"@ethereumjs/tx": "^3.5.2",
32+
"@ethereumjs/common": "^3.2.0",
33+
"@ethereumjs/tx": "^4.2.0",
3434
"@metamask/approval-controller": "workspace:^",
3535
"@metamask/base-controller": "workspace:^",
3636
"@metamask/controller-utils": "workspace:^",
3737
"@metamask/network-controller": "workspace:^",
38-
"@metamask/utils": "^5.0.2",
38+
"@metamask/utils": "^6.2.0",
3939
"async-mutex": "^0.2.6",
4040
"eth-method-registry": "1.1.0",
4141
"eth-query": "^2.1.2",

packages/transaction-controller/src/TransactionController.test.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable jest/expect-expect */
22

3-
import Common from '@ethereumjs/common';
3+
import { Common } from '@ethereumjs/common';
44
import {
55
ChainId,
66
NetworkType,
@@ -1586,15 +1586,12 @@ describe('TransactionController', () => {
15861586

15871587
const config = controller.getCommonConfiguration();
15881588
expect(config).toStrictEqual(
1589-
Common.forCustomChain(
1590-
NetworkType.mainnet,
1591-
{
1592-
name: undefined,
1593-
chainId,
1594-
networkId: chainId,
1595-
},
1596-
HARDFORK,
1597-
),
1589+
Common.custom({
1590+
name: undefined,
1591+
chainId,
1592+
networkId: chainId,
1593+
defaultHardfork: HARDFORK,
1594+
}),
15981595
);
15991596
},
16001597
);

packages/transaction-controller/src/TransactionController.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Common from '@ethereumjs/common';
1+
import { Hardfork, Common, type ChainConfig } from '@ethereumjs/common';
22
import type { TypedTransaction } from '@ethereumjs/tx';
33
import { TransactionFactory } from '@ethereumjs/tx';
44
import type {
@@ -54,7 +54,7 @@ import {
5454
ESTIMATE_GAS_ERROR,
5555
} from './utils';
5656

57-
export const HARDFORK = 'london';
57+
export const HARDFORK = Hardfork.London;
5858

5959
/**
6060
* @type Result
@@ -640,17 +640,14 @@ export class TransactionController extends BaseController<
640640
return new Common({ chain, hardfork: HARDFORK });
641641
}
642642

643-
const customChainParams = {
643+
const customChainParams: Partial<ChainConfig> = {
644644
name,
645645
chainId: parseInt(chainId, 16),
646646
networkId: networkId === null ? NaN : parseInt(networkId, undefined),
647+
defaultHardfork: HARDFORK,
647648
};
648649

649-
return Common.forCustomChain(
650-
NetworkType.mainnet,
651-
customChainParams,
652-
HARDFORK,
653-
);
650+
return Common.custom(customChainParams);
654651
}
655652

656653
/**

0 commit comments

Comments
 (0)