diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-26 04:59:41 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-26 04:59:41 +0800 |
commit | 31e3b9ff8baac145be3e00eedc6d0ae065474b8d (patch) | |
tree | 2ee3bc050892eff5f221b7565ac9cca49c594b47 /packages/subproviders/src | |
parent | b2e32aaf588196b21a453fe7f7e38eb6eb154c22 (diff) | |
download | dexon-sol-tools-31e3b9ff8baac145be3e00eedc6d0ae065474b8d.tar.gz dexon-sol-tools-31e3b9ff8baac145be3e00eedc6d0ae065474b8d.tar.zst dexon-sol-tools-31e3b9ff8baac145be3e00eedc6d0ae065474b8d.zip |
Fix and imprrove ethLightWalletSubprovider
Diffstat (limited to 'packages/subproviders/src')
-rw-r--r-- | packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts b/packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts index 7507eeb49..a908ab5fc 100644 --- a/packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts +++ b/packages/subproviders/src/subproviders/eth_lightwallet_subprovider.ts @@ -15,14 +15,12 @@ import { BaseWalletSubprovider } from './base_wallet_subprovider'; * Source: https://github.com/MetaMask/provider-engine/blob/master/subproviders/subprovider.js */ export class EthLightwalletSubprovider extends BaseWalletSubprovider { - private _signing: any; - private _keystore: any; + private _keystore: lightwallet.keystore; private _pwDerivedKey: Uint8Array; - constructor(signing: lightwallet.signing, keystore: lightwallet.keystore, pwDerivedKey: Uint8Array) { + constructor(keystore: lightwallet.keystore, pwDerivedKey: Uint8Array) { super(); - this._signing = signing; this._keystore = keystore; this._pwDerivedKey = pwDerivedKey; } @@ -54,8 +52,7 @@ export class EthLightwalletSubprovider extends BaseWalletSubprovider { const tx = new EthereumTx(txParams); const txHex = tx.serialize().toString('hex'); - let signedTxHex: string = this._signing.signTx( - this._keystore, this._pwDerivedKey, txHex, txParams.from, this._keystore.hdPathString); + let signedTxHex: string = lightwallet.signing.signTx(this._keystore, this._pwDerivedKey, txHex, txParams.from); signedTxHex = `0x${signedTxHex}`; @@ -78,10 +75,14 @@ export class EthLightwalletSubprovider extends BaseWalletSubprovider { } assert.isHexString('data', data); assert.isETHAddressHex('address', address); - const result: ECSignatureBuffer = await this._signing.signMsgHash( - this._keystore, this._pwDerivedKey, data, address, this._keystore.hdPathString); + const result: ECSignatureBuffer = lightwallet.signing.signMsgHash( + this._keystore, + this._pwDerivedKey, + data, + address, + ); - const signature = this._signing.concatSig(result); + const signature = lightwallet.signing.concatSig(result); return signature; } |