Skip to content

Commit f8f8ce6

Browse files
Merge pull request #2150 from torusresearch/feat/ethereum-update
Update ethereum deps
2 parents 0dd8a81 + b31d0ea commit f8f8ce6

47 files changed

Lines changed: 3600 additions & 845 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 3389 additions & 655 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,17 @@
3030
"test:e2e:mobile": "env MOBILE_ENV=true mocha --timeout=60000 ./test/e2e"
3131
},
3232
"dependencies": {
33-
"@ethereumjs/common": "^2.6.5",
34-
"@ethereumjs/tx": "^3.5.2",
35-
"@gtm-support/vue2-gtm": "^1.3.0",
33+
"@ethereumjs/common": "^3.1.1",
34+
"@ethereumjs/tx": "^4.1.1",
35+
"@ethereumjs/util": "^8.0.5",
36+
"@gtm-support/vue2-gtm": "^2.0.0",
3637
"@metamask/contract-metadata": "^2.2.0",
37-
"@metamask/eth-sig-util": "^4.0.1",
38+
"@metamask/eth-sig-util": "^5.0.2",
3839
"@metamask/obs-store": "^7.0.0",
3940
"@rsksmart/rsk-utils": "^1.1.0",
40-
"@sentry/browser": "^7.38.0",
41-
"@sentry/tracing": "^7.38.0",
42-
"@sentry/vue": "^7.38.0",
41+
"@sentry/browser": "^7.41.0",
42+
"@sentry/tracing": "^7.41.0",
43+
"@sentry/vue": "^7.41.0",
4344
"@toruslabs/broadcast-channel": "^6.1.1",
4445
"@toruslabs/eccrypto": "^1.1.8",
4546
"@toruslabs/http-helpers": "^3.2.0",
@@ -49,32 +50,32 @@
4950
"@toruslabs/openlogin-jrpc": "^3.0.0",
5051
"@toruslabs/openlogin-subkey": "^3.0.0",
5152
"@toruslabs/openlogin-utils": "^3.0.0",
52-
"@uniswap/default-token-list": "^5.2.0",
53+
"@uniswap/default-token-list": "^9.0.1",
5354
"@uniswap/router-sdk": "^1.4.0",
54-
"@uniswap/sdk-core": "^3.1.1",
55+
"@uniswap/sdk-core": "^3.2.1",
5556
"@uniswap/smart-order-router": "^2.10.2",
5657
"@uniswap/v3-sdk": "^3.9.0",
5758
"@walletconnect/core": "^1.8.0",
5859
"@walletconnect/iso-crypto": "^1.8.0",
5960
"await-semaphore": "^0.1.3",
6061
"bignumber.js": "^9.1.1",
62+
"bn.js": "^5.2.1",
6163
"bowser": "^2.11.0",
6264
"copy-to-clipboard": "^3.3.3",
63-
"core-js": "^3.28.0",
65+
"core-js": "^3.29.0",
6466
"create-hash": "^1.2.0",
6567
"das-sdk": "^1.9.3",
6668
"deepmerge": "^4.3.0",
67-
"eth-block-tracker": "^6.1.0",
68-
"eth-json-rpc-filters": "^5.1.0",
69+
"eth-block-tracker": "^7.0.0",
70+
"eth-json-rpc-filters": "^6.0.0",
6971
"eth-json-rpc-infura": "^5.1.0",
70-
"eth-json-rpc-middleware": "^8.1.0",
72+
"eth-json-rpc-middleware": "^9.0.1",
7173
"eth-query": "^2.1.2",
7274
"eth-rpc-errors": "^4.0.3",
73-
"ethereumjs-util": "^7.1.5",
7475
"ethereumjs-wallet": "^1.0.2",
7576
"ethers": "^5.7.2",
7677
"ethjs-query": "^0.3.8",
77-
"fast-json-patch": "^2.2.1",
78+
"fast-json-patch": "^3.1.1",
7879
"human-standard-collectible-abi": "^1.0.2",
7980
"human-standard-token-abi": "^2.0.0",
8081
"jsonschema": "^1.4.1",
@@ -93,7 +94,7 @@
9394
"vue-i18n": "^8.27.2",
9495
"vue-json-pretty": "^1.9.2",
9596
"vue-qr": "^3.2.4",
96-
"vue-qrcode-reader": "^3.1.1",
97+
"vue-qrcode-reader": "^3.1.2",
9798
"vue-router": "^3.6.5",
9899
"vue-spinner": "^1.0.4",
99100
"vuetify": "^2.6.14",
@@ -114,7 +115,7 @@
114115
"@babel/plugin-proposal-class-properties": "^7.18.6",
115116
"@babel/preset-env": "^7.20.2",
116117
"@babel/register": "^7.21.0",
117-
"@sentry/cli": "^2.13.0",
118+
"@sentry/cli": "^2.14.4",
118119
"@vue/cli-plugin-babel": "^5.0.8",
119120
"@vue/cli-plugin-eslint": "^5.0.8",
120121
"@vue/cli-plugin-pwa": "^5.0.8",
@@ -126,9 +127,9 @@
126127
"crypto-browserify": "^3.12.0",
127128
"dotenv": "^16.0.3",
128129
"empty-module": "0.0.2",
129-
"eslint": "^8.34.0",
130+
"eslint": "^8.35.0",
130131
"eslint-config-airbnb-base": "^15.0.0",
131-
"eslint-config-prettier": "^8.6.0",
132+
"eslint-config-prettier": "^8.7.0",
132133
"eslint-config-problems": "^7.0.1",
133134
"eslint-config-standard": "^17.0.0",
134135
"eslint-plugin-import": "^2.27.5",
@@ -138,30 +139,30 @@
138139
"eslint-plugin-promise": "^6.1.1",
139140
"eslint-plugin-simple-import-sort": "^10.0.0",
140141
"eslint-plugin-switch-case": "^1.1.2",
141-
"eslint-plugin-unicorn": "^44.0.2",
142+
"eslint-plugin-unicorn": "^46.0.0",
142143
"eslint-plugin-vue": "^9.9.0",
143144
"eslint-plugin-vue-scoped-css": "^2.4.0",
144145
"express": "^4.18.2",
145146
"fibers": "^5.0.3",
146-
"ganache": "^7.7.5",
147+
"ganache": "^7.7.6",
147148
"https-browserify": "^1.0.0",
148149
"husky": "^8.0.3",
149-
"jsdom": "^20.0.3",
150+
"jsdom": "^21.1.0",
150151
"jsdom-global": "^3.0.2",
151152
"lint-staged": "^13.1.2",
152153
"lodash-es": "^4.17.21",
153-
"luxon": "^3.2.1",
154+
"luxon": "^3.3.0",
154155
"mocha": "^10.2.0",
155156
"nock": "13.3.0",
156157
"node-fetch": "^3.3.0",
157158
"nyc": "^15.1.0",
158159
"os-browserify": "^0.3.0",
159160
"prettier": "^2.8.4",
160161
"process": "^0.11.10",
161-
"puppeteer": "^19.7.2",
162+
"puppeteer": "^19.7.3",
162163
"sass": "~1.32.13",
163164
"sass-loader": "^13.2.0",
164-
"sinon": "^14.0.2",
165+
"sinon": "^15.0.1",
165166
"stream-browserify": "^3.0.0",
166167
"stream-http": "^3.2.0",
167168
"stylus": "^0.59.0",

src/components/Confirm/ConfirmForm/ConfirmForm.vue

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ export default {
610610
return `~ ${totalCost} ${this.selectedCurrency}`
611611
},
612612
currencyMultiplier() {
613-
const currencyMultiplierNumber = this.selectedCurrency !== 'ETH' ? this.currencyData[this.selectedCurrency.toLowerCase()] || 1 : 1
613+
const currencyMultiplierNumber = this.selectedCurrency === 'ETH' ? 1 : this.currencyData[this.selectedCurrency.toLowerCase()] || 1
614614
return new BigNumber(currencyMultiplierNumber)
615615
},
616616
getCurrencyRate() {
@@ -660,18 +660,7 @@ export default {
660660
this.id = id
661661
this.message = data
662662
this.sender = from
663-
} else if (type !== TRANSACTION_TYPES.STANDARD_TRANSACTION) {
664-
const { msgParams: { message, typedMessages } = {}, id = '' } = msgParams || {}
665-
let finalTypedMessages = typedMessages
666-
try {
667-
finalTypedMessages = typedMessages && JSON.parse(typedMessages)
668-
} catch (error) {
669-
log.error(error)
670-
}
671-
this.id = id
672-
this.message = message
673-
this.typedMessages = finalTypedMessages
674-
} else {
663+
} else if (type === TRANSACTION_TYPES.STANDARD_TRANSACTION) {
675664
let finalValue = new BigNumber('0')
676665
const { simulationFails, id, transactionCategory, methodParams, contractParams, txParams: txObject, userInfo } = txParams || {}
677666
const { value, to, data, from: sender, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas } = txObject || {}
@@ -782,7 +771,7 @@ export default {
782771
this.gasEstimate = new BigNumber(gas, 16) // gas number
783772
this.gasEstimateDefault = new BigNumber(gas, 16) // gas number
784773
this.txData = data // data hex
785-
this.txDataParams = txDataParameters !== '' ? JSON.stringify(txDataParameters, null, 2) : ''
774+
this.txDataParams = txDataParameters === '' ? '' : JSON.stringify(txDataParameters, null, 2)
786775
this.sender = sender // address of sender
787776
this.gasCost = this.gasEstimate.times(gweiGasPrice).div(new BigNumber('10').pow(new BigNumber('9')))
788777
this.txFees = this.gasCost.times(this.currencyMultiplier)
@@ -804,6 +793,17 @@ export default {
804793
this.errorMsg = ''
805794
this.topUpErrorShow = false
806795
}
796+
} else {
797+
const { msgParams: { message, typedMessages } = {}, id = '' } = msgParams || {}
798+
let finalTypedMessages = typedMessages
799+
try {
800+
finalTypedMessages = typedMessages && JSON.parse(typedMessages)
801+
} catch (error) {
802+
log.error(error)
803+
}
804+
this.id = id
805+
this.message = message
806+
this.typedMessages = finalTypedMessages
807807
}
808808
this.type = type // type of tx
809809
},

src/components/Confirm/PermissionConfirm/PermissionConfirm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default {
120120
return this.supportedNetworks[this.network].networkName
121121
}
122122
123-
finalNetwork = !state.networkType.networkName ? state.networkType.host : state.networkType.networkName
123+
finalNetwork = state.networkType.networkName ? state.networkType.networkName : state.networkType.host
124124
return finalNetwork
125125
},
126126
}),

src/components/WalletAccount/AccountImport/AccountImport.vue

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@
149149
/* eslint-disable import/default */
150150
/* eslint-disable import/no-webpack-loader-syntax */
151151
/* eslint-disable import/extensions */
152+
import { bufferToHex, stripHexPrefix } from '@ethereumjs/util'
152153
import { BroadcastChannel } from '@toruslabs/broadcast-channel'
153154
import { randomId } from '@toruslabs/openlogin-utils'
154-
import { bufferToHex, stripHexPrefix } from 'ethereumjs-util'
155155
import log from 'loglevel'
156156
import WalletWorker from 'worker-loader!../../../utils/wallet.worker.js'
157157
@@ -245,22 +245,7 @@ export default {
245245
this.setErrorState(new Error('Unable to parse keystore file'))
246246
return
247247
}
248-
if (!window.Worker) {
249-
this.$store
250-
.dispatch('importAccount', { keyData: [keyData, this.jsonPassword], strategy: 'JSON File' })
251-
.then((privKey) => {
252-
this.onClose()
253-
this.keyStoreFileContents = ''
254-
this.jsonPassword = ''
255-
this.showJsonPassword = false
256-
this.isLoadingKeystore = false
257-
this.informClients(privKey)
258-
this.$refs.jsonFileForm.resetValidation()
259-
})
260-
.catch((error) => {
261-
this.setErrorState(error)
262-
})
263-
} else {
248+
if (window.Worker) {
264249
const worker = new WalletWorker()
265250
worker.addEventListener('message', (event) => {
266251
const { privateKey: bufferPrivateKey } = event.data
@@ -286,6 +271,21 @@ export default {
286271
this.isLoadingKeystore = false
287272
})
288273
worker.postMessage({ type: 'unlockWallet', data: [keyData, this.jsonPassword] })
274+
} else {
275+
this.$store
276+
.dispatch('importAccount', { keyData: [keyData, this.jsonPassword], strategy: 'JSON File' })
277+
.then((privKey) => {
278+
this.onClose()
279+
this.keyStoreFileContents = ''
280+
this.jsonPassword = ''
281+
this.showJsonPassword = false
282+
this.isLoadingKeystore = false
283+
this.informClients(privKey)
284+
this.$refs.jsonFileForm.resetValidation()
285+
})
286+
.catch((error) => {
287+
this.setErrorState(error)
288+
})
289289
}
290290
}
291291
},

src/components/WalletSettings/Network/Network.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export default {
186186
...mapGetters(['supportedNetworks']),
187187
...mapState(['networkType']),
188188
networks() {
189-
return [...Object.values(this.supportedNetworks)]
189+
return Object.values(this.supportedNetworks)
190190
},
191191
isRPCSelected() {
192192
return this.selectedNetwork.host === RPC

src/components/WalletSettings/PrivateKeys/PrivateKeys.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
/* eslint-disable import/default */
166166
/* eslint-disable import/no-webpack-loader-syntax */
167167
/* eslint-disable import/extensions */
168-
import { stripHexPrefix } from 'ethereumjs-util'
168+
import { stripHexPrefix } from '@ethereumjs/util'
169169
import Wallet from 'ethereumjs-wallet'
170170
import log from 'loglevel'
171171
import { mapState } from 'vuex'
@@ -216,11 +216,7 @@ export default {
216216
if (this.$refs.downloadForm.validate()) {
217217
this.isLoadingDownloadWallet = true
218218
219-
if (!window.Worker) {
220-
const finishedWallet = await this.createWallet(this.keyStorePassword)
221-
this.exportKeyStoreFile(finishedWallet)
222-
this.isLoadingDownloadWallet = false
223-
} else {
219+
if (window.Worker) {
224220
const worker = new WalletWorker()
225221
worker.addEventListener('message', (ev) => {
226222
const finishedWallet = ev.data
@@ -233,6 +229,10 @@ export default {
233229
})
234230
// log.info(this.keyStorePassword, this.selectedKey)
235231
worker.postMessage({ type: 'createWallet', data: [this.keyStorePassword, this.selectedKey] })
232+
} else {
233+
const finishedWallet = await this.createWallet(this.keyStorePassword)
234+
this.exportKeyStoreFile(finishedWallet)
235+
this.isLoadingDownloadWallet = false
236236
}
237237
}
238238
},

src/components/WalletSettings/TorusKeyDialog/TorusKeyDialog.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@
8686
</template>
8787

8888
<script>
89-
import { addHexPrefix, BN, isValidPrivate, stripHexPrefix, toBuffer } from 'ethereumjs-util'
89+
import { addHexPrefix, isValidPrivate, stripHexPrefix, toBuffer } from '@ethereumjs/util'
90+
import BN from 'bn.js'
9091
import log from 'loglevel'
9192
9293
export default {

src/components/helpers/TransactionFeeAdvanced/TransactionFeeAdvanced.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ export default {
325325
},
326326
gasFees(newValue, oldValue) {
327327
if (!isEqual(newValue, oldValue)) {
328-
this.updateDetails(this.newSelectedSpeed !== '' ? this.newSelectedSpeed : this.oldSelectedSpeed)
328+
this.updateDetails(this.newSelectedSpeed === '' ? this.oldSelectedSpeed : this.newSelectedSpeed)
329329
}
330330
},
331331
showAdvance(value) {

src/components/helpers/TransferAdvanceOption/TransferAdvanceOption.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export default {
282282
this.newNonce = this.nonce >= 0 ? this.nonce : this.nonceItems[0]
283283
},
284284
convertedDisplay(amount, multiplier) {
285-
return !BigNumber.isBigNumber(amount) ? new BigNumber(amount).times(multiplier) : amount.times(multiplier)
285+
return BigNumber.isBigNumber(amount) ? amount.times(multiplier) : new BigNumber(amount).times(multiplier)
286286
},
287287
},
288288
}

0 commit comments

Comments
 (0)