From 42dff702b542e0b64395bac0489b79526dc50d05 Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Wed, 26 May 2021 21:17:13 -0500 Subject: [PATCH] wip --- .prettierrc.js | 10 ++ index.js | 158 ++++++++++++++++++++------------ package.json | 3 +- test/test-eth-trezor-keyring.js | 72 ++++++++++++--- yarn.lock | 158 +++++++++++--------------------- 5 files changed, 222 insertions(+), 179 deletions(-) create mode 100644 .prettierrc.js diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..af6d33c --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,10 @@ +/** + * This file just exists to enable devs that use vscode to benefit from auto + * formatting on save when using prettier plugin and the require config file + * setting. It grabs the config from the shared eslint-config and re-exports + * it to prevent any issues with mismatched settings + */ +const config = require('@metamask/eslint-config'); +const prettierConfig = config.rules[`prettier/prettier`][1]; + +module.exports = prettierConfig; diff --git a/index.js b/index.js index 97f73c7..a01d9e5 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,8 @@ const { EventEmitter } = require('events'); const ethUtil = require('ethereumjs-util'); -const Transaction = require('ethereumjs-tx'); const HDKey = require('hdkey'); const TrezorConnect = require('trezor-connect').default; +const { TransactionFactory } = require('@ethereumjs/tx'); const hdPathString = `m/44'/60'/0'/0`; const keyringType = 'Trezor Hardware'; @@ -14,6 +14,10 @@ const TREZOR_CONNECT_MANIFEST = { appUrl: 'https://metamask.io', }; +function wait(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + class TrezorKeyring extends EventEmitter { constructor(opts = {}) { super(); @@ -167,65 +171,101 @@ class TrezorKeyring extends EventEmitter { // tx is an instance of the ethereumjs-transaction class. signTransaction(address, tx) { - return new Promise((resolve, reject) => { - this.unlock() - .then((status) => { - setTimeout( - (_) => { - TrezorConnect.ethereumSignTransaction({ - path: this._pathFromAddress(address), - transaction: { - to: this._normalize(tx.to), - value: this._normalize(tx.value), - data: this._normalize(tx.data), - chainId: tx._chainId, - nonce: this._normalize(tx.nonce), - gasLimit: this._normalize(tx.gasLimit), - gasPrice: this._normalize(tx.gasPrice), - }, - }) - .then((response) => { - if (response.success) { - tx.v = response.payload.v; - tx.r = response.payload.r; - tx.s = response.payload.s; - - const signedTx = new Transaction(tx); - - const addressSignedWith = ethUtil.toChecksumAddress( - `0x${signedTx.from.toString('hex')}`, - ); - const correctAddress = ethUtil.toChecksumAddress(address); - if (addressSignedWith !== correctAddress) { - reject( - new Error('signature doesnt match the right address'), - ); - } + // transactions built with older versions of ethereumjs-tx have a + // getChainId method that newer versions do not. Older versions are mutable + // while newer versions default to being immutable. Expected shape and type + // of data for v, r and s differ (Buffer (old) vs BN (new)) + if (typeof tx.getChainId === 'function') { + // In this version of ethereumjs-tx we must add the chainId in hex format + // to the initial v value. The chainId must be included in the serialized + // transaction which is only communicated to ethereumjs-tx in this + // value. In newer versions the chainId is communicated via the 'Common' + // object. + return this._signTransaction(address, tx.getChainId(), tx, (payload) => { + tx.v = Buffer.from(payload.v, 'hex'); + tx.r = Buffer.from(payload.r, 'hex'); + tx.s = Buffer.from(payload.s, 'hex'); + return tx; + }); + } + // For transactions created by newer versions of @ethereumjs/tx + // Note: https://github.com/ethereumjs/ethereumjs-monorepo/issues/1188 + // It is not strictly necessary to do this additional setting of the v + // value. We should be able to get the correct v value in serialization + // if the above issue is resolved. Until then this must be set before + // calling .serialize(). Note we are creating a temporarily mutable object + // forfeiting the benefit of immutability until this happens. We do still + // return a Transaction that is frozen if the originally provided + // transaction was also frozen. + const unfrozenTx = TransactionFactory.fromTxData(tx.toJSON(), { + common: tx.common, + freeze: false, + }); + unfrozenTx.v = new ethUtil.BN( + ethUtil.addHexPrefix(tx.common.chainId()), + 'hex', + ); + return this._signTransaction( + address, + tx.common.chainIdBN().toNumber(), + unfrozenTx, + (payload) => { + // Because tx will be immutable, first get a plain javascript object that + // represents the transaction. Using txData here as it aligns with the + // nomenclature of ethereumjs/tx. + const txData = tx.toJSON(); + // The fromTxData utility expects v,r and s to be hex prefixed + txData.v = ethUtil.addHexPrefix(payload.v); + txData.r = ethUtil.addHexPrefix(payload.r); + txData.s = ethUtil.addHexPrefix(payload.s); + // Adopt the 'common' option from the original transaction and set the + // returned object to be frozen if the original is frozen. + return TransactionFactory.fromTxData(txData, { + common: tx.common, + freeze: Object.isFrozen(tx), + }); + }, + ); + } - resolve(signedTx); - } else { - reject( - new Error( - (response.payload && response.payload.error) || - 'Unknown error', - ), - ); - } - }) - .catch((e) => { - reject(new Error((e && e.toString()) || 'Unknown error')); - }); + // tx is an instance of the ethereumjs-transaction class. + async _signTransaction(address, chainId, tx, handleSigning) { + try { + const status = await this.unlock(); + await wait(status === 'just unlocked' ? DELAY_BETWEEN_POPUPS : 0); + const response = await TrezorConnect.ethereumSignTransaction({ + path: this._pathFromAddress(address), + transaction: { + to: this._normalize(tx.to), + value: this._normalize(tx.value), + data: this._normalize(tx.data), + chainId, + nonce: this._normalize(tx.nonce), + gasLimit: this._normalize(tx.gasLimit), + gasPrice: this._normalize(tx.gasPrice), + }, + }); + if (response.success) { + const newOrMutatedTx = handleSigning(response.payload); + + const addressSignedWith = ethUtil.toChecksumAddress( + ethUtil.addHexPrefix( + newOrMutatedTx.getSenderAddress().toString('hex'), + ), + ); + const correctAddress = ethUtil.toChecksumAddress(address); + if (addressSignedWith !== correctAddress) { + throw new Error("signature doesn't match the right address"); + } - // This is necessary to avoid popup collision - // between the unlock & sign trezor popups - }, - status === 'just unlocked' ? DELAY_BETWEEN_POPUPS : 0, - ); - }) - .catch((e) => { - reject(new Error((e && e.toString()) || 'Unknown error')); - }); - }); + return newOrMutatedTx; + } + throw new Error( + (response.payload && response.payload.error) || 'Unknown error', + ); + } catch (e) { + throw new Error((e && e.toString()) || 'Unknown error'); + } } signMessage(withAccount, data) { @@ -266,7 +306,6 @@ class TrezorKeyring extends EventEmitter { } }) .catch((e) => { - console.log('Error while trying to sign a message ', e); reject(new Error((e && e.toString()) || 'Unknown error')); }); // This is necessary to avoid popup collision @@ -276,7 +315,6 @@ class TrezorKeyring extends EventEmitter { ); }) .catch((e) => { - console.log('Error while trying to sign a message ', e); reject(new Error((e && e.toString()) || 'Unknown error')); }); }); diff --git a/package.json b/package.json index 76aab84..1fc45bc 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "mocha/mkdirp": "^0.5.1" }, "dependencies": { + "@ethereumjs/tx": "^3.1.4", "eth-sig-util": "^1.4.2", "ethereumjs-tx": "^1.3.4", "ethereumjs-util": "^7.0.9", @@ -41,10 +42,10 @@ "trezor-connect": "8.1.23-extended" }, "devDependencies": { + "@ethereumjs/common": "^2.2.0", "@metamask/eslint-config": "^6.0.0", "@metamask/eslint-config-mocha": "^6.0.0", "@metamask/eslint-config-nodejs": "^6.0.0", - "babel-eslint": "^10.1.0", "chai": "^4.1.2", "chai-spies": "^1.0.0", "eslint": "^7.26.0", diff --git a/test/test-eth-trezor-keyring.js b/test/test-eth-trezor-keyring.js index 5f8f353..e65657f 100644 --- a/test/test-eth-trezor-keyring.js +++ b/test/test-eth-trezor-keyring.js @@ -10,6 +10,8 @@ const sinon = require('sinon'); const EthereumTx = require('ethereumjs-tx'); const HDKey = require('hdkey'); const TrezorConnect = require('trezor-connect').default; +const { TransactionFactory } = require('@ethereumjs/tx'); +const Common = require('@ethereumjs/common').default; const TrezorKeyring = require('..'); @@ -49,6 +51,19 @@ const fakeTx = new EthereumTx({ chainId: 1, }); +const common = new Common({ chain: 'mainnet' }); +const newFakeTx = TransactionFactory.fromTxData( + { + nonce: '0x00', + gasPrice: '0x09184e72a000', + gasLimit: '0x2710', + to: '0x0000000000000000000000000000000000000000', + value: '0x00', + data: '0x7f7465737432000000000000000000000000000000000000000000000000000000600057', + }, + { common, freeze: false }, +); + chai.use(spies); describe('TrezorKeyring', function () { @@ -328,19 +343,54 @@ describe('TrezorKeyring', function () { }); describe('signTransaction', function () { - it('should call TrezorConnect.ethereumSignTransaction', function (done) { - sinon - .stub(TrezorConnect, 'ethereumSignTransaction') - .callsFake(() => Promise.resolve({})); + it('should pass serialized transaction to trezor and return signed tx', async function () { + sinon.stub(TrezorConnect, 'ethereumSignTransaction').callsFake(() => { + return Promise.resolve({ + success: true, + payload: { v: '0x1', r: '0x0', s: '0x0' }, + }); + }); + sinon.stub(fakeTx, 'verifySignature').callsFake(() => true); + sinon.stub(fakeTx, 'getSenderAddress').callsFake(() => fakeAccounts[0]); + + const returnedTx = await keyring.signTransaction(fakeAccounts[0], fakeTx); + // assert that the v,r,s values got assigned to tx. + assert.ok(returnedTx.v); + assert.ok(returnedTx.r); + assert.ok(returnedTx.s); + // ensure we get a older version transaction back + assert.equal(returnedTx.getChainId(), 1); + assert.equal(returnedTx.common, undefined); + assert(TrezorConnect.ethereumSignTransaction.calledOnce); + }); - keyring.signTransaction(fakeAccounts[0], fakeTx).catch((_) => { - // Since we only care about ensuring our function gets called, - // we want to ignore warnings due to stub data + it('should pass serialized newer transaction to trezor and return signed tx', async function () { + sinon.stub(TransactionFactory, 'fromTxData').callsFake(() => { + // without having a private key/public key pair in this test, we have + // mock out this method and return the original tx because we can't + // replicate r and s values without the private key. + return newFakeTx; }); - setTimeout(() => { - assert(TrezorConnect.ethereumSignTransaction.calledOnce); - done(); - }, SIGNING_DELAY); + sinon.stub(TrezorConnect, 'ethereumSignTransaction').callsFake(() => { + return Promise.resolve({ + success: true, + payload: { v: '0x25', r: '0x0', s: '0x0' }, + }); + }); + sinon + .stub(newFakeTx, 'getSenderAddress') + .callsFake(() => fakeAccounts[0]); + sinon.stub(newFakeTx, 'verifySignature').callsFake(() => true); + // sinon.stub(newFakeTx, 'from').get(() => fakeAccounts[0]); + + const returnedTx = await keyring.signTransaction( + fakeAccounts[0], + newFakeTx, + ); + // ensure we get a new version transaction back + assert.equal(returnedTx.getChainId, undefined); + assert.equal(returnedTx.common.chainIdBN().toString('hex'), '1'); + assert(TrezorConnect.ethereumSignTransaction.calledOnce); }); }); diff --git a/yarn.lock b/yarn.lock index 234aa90..10d3baa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,45 +2,13 @@ # yarn lockfile v1 -"@babel/code-frame@7.12.11", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4": +"@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== dependencies: "@babel/highlight" "^7.10.4" -"@babel/generator@^7.11.5": - version "7.11.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.11.5.tgz#a5582773425a468e4ba269d9a1f701fbca6a7a82" - integrity sha512-9UqHWJ4IwRTy4l0o8gq2ef8ws8UPzvtMkVKjTLAiRmza9p9V6Z+OfuNd9fB1j5Q67F+dVJtPC2sZXI8NM9br4g== - dependencies: - "@babel/types" "^7.11.5" - jsesc "^2.5.1" - source-map "^0.6.1" - -"@babel/helper-function-name@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz#d2d3b20c59ad8c47112fa7d2a94bc09d5ef82f1a" - integrity sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ== - dependencies: - "@babel/helper-get-function-arity" "^7.10.4" - "@babel/template" "^7.10.4" - "@babel/types" "^7.10.4" - -"@babel/helper-get-function-arity@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz#98c1cbea0e2332f33f9a4661b8ce1505b2c19ba2" - integrity sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A== - dependencies: - "@babel/types" "^7.10.4" - -"@babel/helper-split-export-declaration@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz#f8a491244acf6a676158ac42072911ba83ad099f" - integrity sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg== - dependencies: - "@babel/types" "^7.11.0" - "@babel/helper-validator-identifier@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" @@ -55,11 +23,6 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.10.4", "@babel/parser@^7.11.5", "@babel/parser@^7.7.0": - version "7.11.5" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.11.5.tgz#c7ff6303df71080ec7a4f5b8c003c58f1cf51037" - integrity sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q== - "@babel/runtime@^7.12.5": version "7.12.5" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e" @@ -67,39 +30,6 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.4.tgz#3251996c4200ebc71d1a8fc405fba940f36ba278" - integrity sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/parser" "^7.10.4" - "@babel/types" "^7.10.4" - -"@babel/traverse@^7.7.0": - version "7.11.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.11.5.tgz#be777b93b518eb6d76ee2e1ea1d143daa11e61c3" - integrity sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.11.5" - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-split-export-declaration" "^7.11.0" - "@babel/parser" "^7.11.5" - "@babel/types" "^7.11.5" - debug "^4.1.0" - globals "^11.1.0" - lodash "^4.17.19" - -"@babel/types@^7.10.4", "@babel/types@^7.11.0", "@babel/types@^7.11.5", "@babel/types@^7.7.0": - version "7.11.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.11.5.tgz#d9de577d01252d77c6800cee039ee64faf75662d" - integrity sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q== - dependencies: - "@babel/helper-validator-identifier" "^7.10.4" - lodash "^4.17.19" - to-fast-properties "^2.0.0" - "@eslint/eslintrc@^0.4.1": version "0.4.1" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.1.tgz#442763b88cecbe3ee0ec7ca6d6dd6168550cbf14" @@ -115,6 +45,22 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@ethereumjs/common@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.2.0.tgz#850a3e3e594ee707ad8d44a11e8152fb62450535" + integrity sha512-PyQiTG00MJtBRkJmv46ChZL8u2XWxNBeAthznAUIUiefxPAXjbkuiCZOuncgJS34/XkMbNc9zMt/PlgKRBElig== + dependencies: + crc-32 "^1.2.0" + ethereumjs-util "^7.0.9" + +"@ethereumjs/tx@^3.1.4": + version "3.1.4" + resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.1.4.tgz#04cf9e9406da5f04a1a26c458744641f4b4b8dd0" + integrity sha512-6cJpmmjCpG5ZVN9NJYtWvmrEQcevw9DIR8hj2ca2PszD2fxbIFXky3Z37gpf8S6u0Npv09kG8It+G4xjydZVLg== + dependencies: + "@ethereumjs/common" "^2.2.0" + ethereumjs-util "^7.0.10" + "@metamask/eslint-config-mocha@^6.0.0": version "6.0.0" resolved "https://registry.yarnpkg.com/@metamask/eslint-config-mocha/-/eslint-config-mocha-6.0.0.tgz#407fc07d4bdfbc79b64989fa9a56a5a671aa4721" @@ -372,18 +318,6 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -babel-eslint@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" - integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - eslint-visitor-keys "^1.0.0" - resolve "^1.12.0" - babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" @@ -725,6 +659,14 @@ core-js@^2.4.0: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== +crc-32@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.0.tgz#cb2db6e29b88508e32d9dd0ec1693e7b41a18208" + integrity sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA== + dependencies: + exit-on-epipe "~1.0.1" + printj "~1.1.0" + create-hash@^1.1.0, create-hash@^1.1.1, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" @@ -769,7 +711,7 @@ debug@3.1.0, debug@~3.1.0: dependencies: ms "2.0.0" -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: +debug@4, debug@^4.0.1, debug@^4.1.1: version "4.3.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== @@ -1061,7 +1003,7 @@ eslint-utils@^2.0.0, eslint-utils@^2.1.0: dependencies: eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: +eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== @@ -1220,6 +1162,18 @@ ethereumjs-util@^5.0.0, ethereumjs-util@^5.1.1: safe-buffer "^5.1.1" secp256k1 "^3.0.1" +ethereumjs-util@^7.0.10: + version "7.0.10" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.0.10.tgz#5fb7b69fa1fda0acc59634cf39d6b0291180fc1f" + integrity sha512-c/xThw6A+EAnej5Xk5kOzFzyoSnw0WX0tSlZ6pAsfGVvQj3TItaDg9b1+Fz1RJXA+y2YksKwQnuzgt1eY6LKzw== + dependencies: + "@types/bn.js" "^5.1.0" + bn.js "^5.1.2" + create-hash "^1.1.2" + ethereum-cryptography "^0.1.3" + ethjs-util "0.1.6" + rlp "^2.2.4" + ethereumjs-util@^7.0.9: version "7.0.9" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.0.9.tgz#2038baeb30f370a3e576ec175bd70bbbb6807d42" @@ -1251,6 +1205,11 @@ evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" +exit-on-epipe@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692" + integrity sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw== + fast-deep-equal@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -1360,11 +1319,6 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.1.0: - version "11.11.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.11.0.tgz#dcf93757fa2de5486fbeed7118538adf789e9c2e" - integrity sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw== - globals@^12.1.0: version "12.4.0" resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" @@ -1671,11 +1625,6 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -1788,7 +1737,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= -lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4: +lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.4: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -2128,6 +2077,11 @@ prettier@^2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== +printj@~1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/printj/-/printj-1.1.2.tgz#d90deb2975a8b9f600fb3a1c94e3f4c53c78a222" + integrity sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ== + progress@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" @@ -2223,7 +2177,7 @@ resolve-from@^4.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0: +resolve@^1.10.0, resolve@^1.13.1, resolve@^1.17.0: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== @@ -2469,11 +2423,6 @@ socket.io-parser@~3.3.0: debug "~3.1.0" isarray "2.0.1" -source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" @@ -2633,11 +2582,6 @@ to-array@0.1.4: resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" integrity sha1-F+bBH3PdTz10zaek/zI46a2b+JA= -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - trezor-connect@8.1.23-extended: version "8.1.23-extended" resolved "https://registry.yarnpkg.com/trezor-connect/-/trezor-connect-8.1.23-extended.tgz#353369a9f136216630b9673a239dcdb140abe49e"