meriadec
7 years ago
No known key found for this signature in database
GPG Key ID: 1D2FC2305E2CB399
4 changed files with
27 additions and
14 deletions
-
package.json
-
src/bridge/EthereumJSBridge.js
-
src/components/DeviceCheckAddress.js
-
yarn.lock
|
|
@ -40,7 +40,7 @@ |
|
|
|
"@ledgerhq/hw-transport": "^4.12.0", |
|
|
|
"@ledgerhq/hw-transport-node-hid": "^4.12.0", |
|
|
|
"@ledgerhq/ledger-core": "^1.0.1", |
|
|
|
"@ledgerhq/live-common": "^2.7.2", |
|
|
|
"@ledgerhq/live-common": "^2.7.5", |
|
|
|
"axios": "^0.18.0", |
|
|
|
"babel-runtime": "^6.26.0", |
|
|
|
"bcryptjs": "^2.4.3", |
|
|
@ -83,7 +83,7 @@ |
|
|
|
"redux-thunk": "^2.2.0", |
|
|
|
"reselect": "^3.0.1", |
|
|
|
"rxjs": "^6.2.0", |
|
|
|
"rxjs-compat": "^6.2.0", |
|
|
|
"rxjs-compat": "^6.1.0", |
|
|
|
"smooth-scrollbar": "^8.2.7", |
|
|
|
"source-map": "0.7.2", |
|
|
|
"source-map-support": "^0.5.4", |
|
|
|
|
|
@ -97,12 +97,12 @@ const EthereumBridge: WalletBridge<Transaction> = { |
|
|
|
const account: Account = { |
|
|
|
id: accountId, |
|
|
|
xpub: '', |
|
|
|
path, |
|
|
|
path, // FIXME we probably not want the address path in the account.path
|
|
|
|
walletPath: String(index), |
|
|
|
name: 'New Account', |
|
|
|
isSegwit: false, |
|
|
|
address, |
|
|
|
addresses: [address], |
|
|
|
addresses: [{ str: address, path, }], |
|
|
|
balance, |
|
|
|
blockHeight: currentBlock.height, |
|
|
|
archived: true, |
|
|
@ -128,12 +128,12 @@ const EthereumBridge: WalletBridge<Transaction> = { |
|
|
|
const account: Account = { |
|
|
|
id: accountId, |
|
|
|
xpub: '', |
|
|
|
path, |
|
|
|
path, // FIXME we probably not want the address path in the account.path
|
|
|
|
walletPath: String(index), |
|
|
|
name: address.slice(32), |
|
|
|
isSegwit: false, |
|
|
|
address, |
|
|
|
addresses: [address], |
|
|
|
addresses: [{ str: address, path, }], |
|
|
|
balance, |
|
|
|
blockHeight: currentBlock.height, |
|
|
|
archived: true, |
|
|
|
|
|
@ -27,6 +27,19 @@ class CheckAddress extends PureComponent<Props, State> { |
|
|
|
this.verifyAddress({ device, account }) |
|
|
|
} |
|
|
|
|
|
|
|
componentWillUnmount() { |
|
|
|
this._isUnmounted = true |
|
|
|
} |
|
|
|
|
|
|
|
_isUnmounted = false |
|
|
|
|
|
|
|
safeSetState = (...args: *) => { |
|
|
|
if (this._isUnmounted) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.setState(...args) |
|
|
|
} |
|
|
|
|
|
|
|
verifyAddress = async ({ device, account }: { device: Device, account: Account }) => { |
|
|
|
try { |
|
|
|
// TODO: this will work only for BTC-like accounts
|
|
|
@ -49,10 +62,10 @@ class CheckAddress extends PureComponent<Props, State> { |
|
|
|
throw new Error('Confirmed address is different') |
|
|
|
} |
|
|
|
|
|
|
|
this.setState({ isVerified: true }) |
|
|
|
this.safeSetState({ isVerified: true }) |
|
|
|
this.props.onCheck(true) |
|
|
|
} catch (err) { |
|
|
|
this.setState({ isVerified: false }) |
|
|
|
this.safeSetState({ isVerified: false }) |
|
|
|
this.props.onCheck(false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
@ -1473,9 +1473,9 @@ |
|
|
|
npm "^5.7.1" |
|
|
|
prebuild-install "^2.2.2" |
|
|
|
|
|
|
|
"@ledgerhq/live-common@^2.7.2": |
|
|
|
version "2.7.2" |
|
|
|
resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-2.7.2.tgz#abfa71428c186220006d35baca44261a1c3ef9ed" |
|
|
|
"@ledgerhq/live-common@^2.7.5": |
|
|
|
version "2.7.5" |
|
|
|
resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-2.7.5.tgz#5434bf2e708aaca471be4ca823e613cf27ba700c" |
|
|
|
dependencies: |
|
|
|
axios "^0.18.0" |
|
|
|
invariant "^2.2.2" |
|
|
@ -12051,9 +12051,9 @@ rx@2.3.24: |
|
|
|
version "2.3.24" |
|
|
|
resolved "https://registry.yarnpkg.com/rx/-/rx-2.3.24.tgz#14f950a4217d7e35daa71bbcbe58eff68ea4b2b7" |
|
|
|
|
|
|
|
rxjs-compat@^6.2.0: |
|
|
|
version "6.2.0" |
|
|
|
resolved "https://registry.yarnpkg.com/rxjs-compat/-/rxjs-compat-6.2.0.tgz#2eb49cc6ac20d0d7057c6887d1895beaab0966f9" |
|
|
|
rxjs-compat@^6.1.0: |
|
|
|
version "6.1.0" |
|
|
|
resolved "https://registry.yarnpkg.com/rxjs-compat/-/rxjs-compat-6.1.0.tgz#935059623ee4c167728c9dd03ee6e4468cc5b583" |
|
|
|
|
|
|
|
rxjs@^5.1.1, rxjs@^5.4.2, rxjs@^5.5.2: |
|
|
|
version "5.5.10" |
|
|
|