Browse Source

Merge pull request #624 from MortalKastor/save-pubkey

Save pubkey for Ripple and Ethereum accounts
master
Gaëtan Renaudeau 7 years ago
committed by GitHub
parent
commit
b2bdf00bc6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/bridge/EthereumJSBridge.js
  2. 4
      src/bridge/RippleJSBridge.js

4
src/bridge/EthereumJSBridge.js

@ -170,7 +170,7 @@ const EthereumBridge: WalletBridge<Transaction> = {
async function stepAddress( async function stepAddress(
index, index,
{ address, path: freshAddressPath }, { address, path: freshAddressPath, publicKey },
isStandard, isStandard,
): { account?: Account, complete?: boolean } { ): { account?: Account, complete?: boolean } {
const balance = await api.getAccountBalance(address) const balance = await api.getAccountBalance(address)
@ -181,7 +181,7 @@ const EthereumBridge: WalletBridge<Transaction> = {
if (finished) return { complete: true } if (finished) return { complete: true }
const freshAddress = address const freshAddress = address
const accountId = `ethereumjs:${currency.id}:${address}` const accountId = `ethereumjs:${currency.id}:${address}:${publicKey}`
if (txs.length === 0) { if (txs.length === 0) {
// this is an empty account // this is an empty account

4
src/bridge/RippleJSBridge.js

@ -258,12 +258,12 @@ const RippleJSBridge: WalletBridge<Transaction> = {
for (const derivation of derivations) { for (const derivation of derivations) {
for (let index = 0; index < 255; index++) { for (let index = 0; index < 255; index++) {
const freshAddressPath = derivation({ currency, x: index, segwit: false }) const freshAddressPath = derivation({ currency, x: index, segwit: false })
const { address } = await await getAddress const { address, publicKey } = await await getAddress
.send({ currencyId: currency.id, devicePath: deviceId, path: freshAddressPath }) .send({ currencyId: currency.id, devicePath: deviceId, path: freshAddressPath })
.toPromise() .toPromise()
if (finished) return if (finished) return
const accountId = `ripplejs:${currency.id}:${address}` const accountId = `ripplejs:${currency.id}:${address}:${publicKey}`
let info let info
try { try {

Loading…
Cancel
Save