Commit Graph

20 Commits

Author SHA1 Message Date
Braydon Fuller 809ff1461e Restore error when trying to derive a hardened path with HDPublicKey.
- Restores InvalidIndexCantDeriveHardened error in spec
- Passes hardened argument in HDPublicKey (in case the feature is attempted to be used similarly to HDPrivateKey)
- Fixes undefined error with InvalidLength
- Fixes tests to check for the error type
- Various formatting cleanup improvements
2015-08-17 09:21:58 -04:00
Braydon Fuller a50fccef4d Changes behavior of `toJSON` to work as expected with `JSON.stringify`
- see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON%28%29_behavior
- Updates CONTRIBUTING with changes to Stardard Methods
- Aliases toJSON for toObject
- Removes all `fromJSON` methods, and many cases replaces with `fromObject`
- Constructors expect an object parsed via `JSON.parse` for JSON input
2015-08-13 10:46:08 -04:00
eordano a07d90dfbf Fix error on public key for hdpublickey 2015-02-23 12:10:51 -03:00
eordano eb8f59aa27 Drop duplicated code 2015-02-18 13:39:48 -03:00
eordano 9c3170cb3a HDPublicKey: Add precondition checks for static methods 2015-02-18 13:14:12 -03:00
Trevin Hofmann 59a9e40f13 Properly capitalize BufferUtil everywhere
Right out of CONTRIBUTING.md

https://github.com/bitpay/bitcore/blob/master/CONTRIBUTING.md#g6---naming-utility-namespaces
2015-02-13 21:21:06 -06:00
Esteban Ordano 7a73f582b4 HDKeys: add toBuffer/fromBuffer to HDPublicKey 2015-02-05 15:06:01 -03:00
Yemel Jardi 0beed6efa4 Refactor HDPublicKey path validation 2015-01-06 12:08:42 -03:00
Yemel Jardi 884cae7349 Fix another typo 2015-01-06 10:33:31 -03:00
Yemel Jardi 2aa5c65945 Add validations to derivation path 2015-01-02 16:46:37 -03:00
Esteban Ordano 2006b3aae2 Add G7 methods to HDPublicKey 2014-12-23 12:23:35 -03:00
Braydon Fuller b13c4fb0c9 Added inspect prototype G5 2014-12-14 15:13:01 -05:00
Braydon Fuller 94cc10b1a3 Changed *Json to *JSON and returned an object so that methods can be called from other toJSON methods without the double-stringification issue. 2014-12-12 12:06:39 -05:00
Braydon Fuller c73c56f938 HDKeys: Modified to have immutable properties 2014-12-11 15:37:31 -05:00
Esteban Ordano ea17a6ace1 Add a preconditions module, and refactor errors
100% code coverage for the preconditions module.

Usage:
```
$.checkState(something === anotherthing, 'Expected something to be
anotherthing');
$.checkArgument(something < 100, 'something', 'must be less than 100');
$.checkArgumentType(something, PrivateKey, 'something'); // The third
argument is a helper to mention the name of the argument
$.checkArgumentType(something, PrivateKey); // but it's optional (will
show up as "(unknown argument)")
```
2014-12-10 11:56:38 -03:00
Esteban Ordano 13fd2592fc Add autogenerated errors 2014-11-30 09:47:44 -03:00
Esteban Ordano 803027353a Change errors 2014-11-30 09:47:44 -03:00
Esteban Ordano a2a51ecc0c Fix style: move each static function to an appropiate namespace 2014-11-30 09:47:44 -03:00
Esteban Ordano 53900f3196 Add cache to derivation 2014-11-30 09:47:44 -03:00
Esteban Ordano 4c0769fa09 100% test coverage on hdpublickey 2014-11-30 09:47:44 -03:00