Merge remote-tracking branch 'origin/develop' into node-10-support
This commit is contained in:
commit
fcd730a38a
|
@ -5,7 +5,7 @@ const {qrcode: qrCode} = require('qrcode-npm')
|
||||||
const {connect} = require('react-redux')
|
const {connect} = require('react-redux')
|
||||||
const {isHexPrefixed} = require('ethereumjs-util')
|
const {isHexPrefixed} = require('ethereumjs-util')
|
||||||
const CopyButton = require('./components/copy/copy-button')
|
const CopyButton = require('./components/copy/copy-button')
|
||||||
const { toChecksumAddress } = require('./util')
|
const { toChecksumAddress, ifRSK } = require('./util')
|
||||||
|
|
||||||
class AccountQrScreen extends PureComponent {
|
class AccountQrScreen extends PureComponent {
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
|
@ -20,8 +20,8 @@ class AccountQrScreen extends PureComponent {
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const {Qr, warning, network} = this.props
|
const {Qr, warning, network} = this.props
|
||||||
const address = `${isHexPrefixed(Qr.data) ? 'ethereum:' : ''}${Qr.data}`
|
|
||||||
const addressChecksum = toChecksumAddress(network, Qr.data)
|
const addressChecksum = toChecksumAddress(network, Qr.data)
|
||||||
|
const address = ifRSK ? addressChecksum : `${isHexPrefixed(Qr.data) ? 'ethereum:' : ''}${Qr.data}`
|
||||||
const qrImage = qrCode(4, 'M')
|
const qrImage = qrCode(4, 'M')
|
||||||
|
|
||||||
qrImage.addData(address)
|
qrImage.addData(address)
|
||||||
|
|
|
@ -390,7 +390,7 @@ function ifRSK (network) {
|
||||||
function toChecksumAddressRSK (address, chainId = null) {
|
function toChecksumAddressRSK (address, chainId = null) {
|
||||||
const zeroX = '0x'
|
const zeroX = '0x'
|
||||||
const stripAddress = ethUtil.stripHexPrefix(address).toLowerCase()
|
const stripAddress = ethUtil.stripHexPrefix(address).toLowerCase()
|
||||||
const prefix = chainId != null ? (chainId.toString() + zeroX) : ''
|
const prefix = chainId !== null ? (chainId.toString() + zeroX) : ''
|
||||||
const keccakHash = ethUtil.sha3(prefix + stripAddress).toString('hex')
|
const keccakHash = ethUtil.sha3(prefix + stripAddress).toString('hex')
|
||||||
let output = zeroX
|
let output = zeroX
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue