Fix bug on HD*Keys
This commit is contained in:
parent
afb5b6971f
commit
c793559fa9
|
@ -221,7 +221,7 @@ HDPrivateKey.prototype._buildFromObject = function(arg) {
|
|||
// TODO: Type validation
|
||||
var buffers = {
|
||||
version: arg.network ? BufferUtil.integerAsBuffer(Network.get(arg.network).xprivkey) : arg.version,
|
||||
depth: BufferUtil.integerAsSingleByteBuffer(arg.depth),
|
||||
depth: _.isNumber(arg.depth) ? BufferUtil.integerAsSingleByteBuffer(arg.depth) : arg.depth,
|
||||
parentFingerPrint: _.isNumber(arg.parentFingerPrint) ? BufferUtil.integerAsBuffer(arg.parentFingerPrint) : arg.parentFingerPrint,
|
||||
childIndex: _.isNumber(arg.childIndex) ? BufferUtil.integerAsBuffer(arg.childIndex) : arg.childIndex,
|
||||
chainCode: _.isString(arg.chainCode) ? BufferUtil.hexToBuffer(arg.chainCode) : arg.chainCode,
|
||||
|
|
|
@ -231,9 +231,9 @@ HDPublicKey.prototype._buildFromObject = function (arg) {
|
|||
// TODO: Type validation
|
||||
var buffers = {
|
||||
version: arg.network ? BufferUtil.integerAsBuffer(Network.get(arg.network).xpubkey) : arg.version,
|
||||
depth: BufferUtil.integerAsSingleByteBuffer(arg.depth),
|
||||
depth: _.isNumber(arg.depth) ? BufferUtil.integerAsSingleByteBuffer(arg.depth) : arg.depth,
|
||||
parentFingerPrint: _.isNumber(arg.parentFingerPrint) ? BufferUtil.integerAsBuffer(arg.parentFingerPrint) : arg.parentFingerPrint,
|
||||
childIndex: BufferUtil.integerAsBuffer(arg.childIndex),
|
||||
childIndex: _.isNumber(arg.childIndex) ? BufferUtil.integerAsBuffer(arg.childIndex) : arg.childIndex,
|
||||
chainCode: _.isString(arg.chainCode) ? BufferUtil.hexToBuffer(arg.chainCode) : arg.chainCode,
|
||||
publicKey: _.isString(arg.publicKey) ? BufferUtil.hexToBuffer(arg.publicKey) :
|
||||
BufferUtil.isBuffer(arg.publicKey) ? arg.publicKey : arg.publicKey.toBuffer(),
|
||||
|
|
Loading…
Reference in New Issue