Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

HDPublicKey child derivation broken #258

Open
raucao opened this issue Sep 6, 2018 · 0 comments
Open

HDPublicKey child derivation broken #258

raucao opened this issue Sep 6, 2018 · 0 comments

Comments

@raucao
Copy link

raucao commented Sep 6, 2018

When initializing a new HD public key prototype from a string, I get an exception when using deriveChild() on it:

> var hdpub = new bitcore.HDPublicKey('ypub6XdVpDbc22LAzsE5kRjZUbSfTi5GQRsVPFM35riMikM47bZSPUAiNcZ1JxzXmon45saE4X5LhcRiysKBz3hVt2oqwhr7hoUVomTcVjeM8kG')
undefined
> hdpub.deriveChild(0)
AssertionError [ERR_ASSERTION]: version argument is not a buffer, it's undefined
    at checkBuffer (/home/basti/src/solarisbank/crypto-custody/api/node_modules/bitcore-lib/lib/hdpublickey.js:371:5)
    at Function.HDPublicKey._validateBufferArguments (/home/basti/src/solarisbank/crypto-custody/api/node_modules/bitcore-lib/lib/hdpublickey.js:377:3)
    at HDPublicKey._buildFromBuffers (/home/basti/src/solarisbank/crypto-custody/api/node_modules/bitcore-lib/lib/hdpublickey.js:328:15)
    at HDPublicKey._buildFromObject (/home/basti/src/solarisbank/crypto-custody/api/node_modules/bitcore-lib/lib/hdpublickey.js:289:15)
    at new HDPublicKey (/home/basti/src/solarisbank/crypto-custody/api/node_modules/bitcore-lib/lib/hdpublickey.js:58:23)
    at HDPublicKey._deriveWithNumber (/home/basti/src/solarisbank/crypto-custody/api/node_modules/bitcore-lib/lib/hdpublickey.js:173:17)
    at HDPublicKey.deriveChild (/home/basti/src/solarisbank/crypto-custody/api/node_modules/bitcore-lib/lib/hdpublickey.js:144:17)

The initialization doesn't seem to set all the extra properties on the object, like e.g. network, for some reason.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant