Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eth-utils): fix failed test
Browse files Browse the repository at this point in the history
bludnic committed Oct 14, 2023
1 parent 372d0d9 commit c17d47f
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -84,6 +84,7 @@
"vuex": "^4.1.0",
"vuex-persist": "^3.1.3",
"web3-eth": "^4.2.0",
"web3-eth-accounts": "^4.0.6",
"web3-utils": "^4.0.6"
},
"devDependencies": {
3 changes: 2 additions & 1 deletion src/lib/eth-utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import hdkey from 'hdkey'
import * as web3Utils from 'web3-utils'
import { privateKeyToAccount } from 'web3-eth-accounts'
import BigNumber from 'bignumber.js'
import cache from '@/store/cache.js'

@@ -33,7 +34,7 @@ export function getAccountFromPassphrase(passphrase, api) {
hdkey.fromMasterSeed(seed).derive(HD_KEY_PATH)._privateKey
)
// web3Account is for user wallet; We don't need it, when exporting a private key
const web3Account = api ? api.accounts.privateKeyToAccount(privateKey) : undefined
const web3Account = api ? privateKeyToAccount(privateKey) : undefined

return {
web3Account,

0 comments on commit c17d47f

Please sign in to comment.