From 06fd4ee1d4a6846a31f2b48c8e78684cf3525507 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 11 Feb 2021 12:31:25 -0330 Subject: [PATCH] Update `ethereumjs-wallet` from v0.6.5 to v1.0.1 (#347) `ethereumjs-wallet` was migrated to TypeScript in v1, so this update brings types with it. There were various API changes as well [1], which have all been accounted for. [1]: https://github.com/ethereumjs/ethereumjs-wallet/releases/tag/v1.0.0 --- package.json | 2 +- src/keyring/KeyringController.ts | 5 ++-- yarn.lock | 49 ++++++++++++++++++++++++++++++-- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index d7e37edf55..e670b09b4b 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "eth-rpc-errors": "^4.0.0", "eth-sig-util": "^3.0.0", "ethereumjs-util": "^6.1.0", - "ethereumjs-wallet": "^0.6.4", + "ethereumjs-wallet": "^1.0.1", "human-standard-collectible-abi": "^1.0.2", "human-standard-token-abi": "^2.0.0", "isomorphic-fetch": "^3.0.0", diff --git a/src/keyring/KeyringController.ts b/src/keyring/KeyringController.ts index 0c90231b2c..32e910daea 100644 --- a/src/keyring/KeyringController.ts +++ b/src/keyring/KeyringController.ts @@ -5,6 +5,7 @@ import { signTypedData_v4, signTypedDataLegacy, } from 'eth-sig-util'; +import Wallet, { thirdparty as importers } from 'ethereumjs-wallet'; import BaseController, { BaseConfig, BaseState, Listener } from '../BaseController'; import PreferencesController from '../user/PreferencesController'; import { Transaction } from '../transaction/TransactionController'; @@ -13,9 +14,7 @@ import { TypedMessageParams } from '../message-manager/TypedMessageManager'; const Keyring = require('eth-keyring-controller'); const { Mutex } = require('async-mutex'); -const Wallet = require('ethereumjs-wallet'); const ethUtil = require('ethereumjs-util'); -const importers = require('ethereumjs-wallet/thirdparty'); const privates = new WeakMap(); @@ -288,7 +287,7 @@ export class KeyringController extends BaseController