Skip to content

Commit

Permalink
fix privatetoaddress
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyapotti committed Oct 26, 2023
1 parent 1e9676d commit ecb8030
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export default {
dispatch('subscribeToControllers')
commit('setUserInfo', userInfo)

const selectedAddress = `0x${privateToAddress(Buffer.from(privateKey.padStart(64, '0'), 'hex')).toString('hex')}`
const selectedAddress = `0x${Buffer.from(privateToAddress(Buffer.from(privateKey.padStart(64, '0'), 'hex'))).toString('hex')}`
await dispatch('initTorusKeyring', {
keys: [
{
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ export function generateAddressFromPubKey(point) {
}

export function generateAddressFromPrivateKey(privKey) {
return toChecksumAddress(normalize(privateToAddress(Buffer.from(privKey.padStart(64, '0'), 'hex')).toString('hex')))
return toChecksumAddress(normalize(Buffer.from(privateToAddress(Buffer.from(privKey.padStart(64, '0'), 'hex'))).toString('hex')))
}

export function rskToChecksumAddress(address, chainId) {
Expand Down

0 comments on commit ecb8030

Please sign in to comment.