Commit Graph

21 Commits

Author SHA1 Message Date
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
Manuel Araoz 951a07c011 fix PublicKey.toObject 2015-05-11 12:24:45 -03:00
Esteban Ordano 73a973359b Fix invocations to binary operations called on numbers 2015-02-05 17:28:45 -03:00
Braydon Fuller 84cc1a0042 Indicate internal use of getID with an underscore. 2015-01-09 10:20:27 -05:00
Braydon Fuller b38f7fa319 Added getID to PublicKey
- Tests in BloomFilter in [bitcoin core](https://github.com/bitcoin/bitcoin/blob/master/src/test/bloom_tests.cpp#L85) use the CPubKey.GetID as input into the BloomFilter
- The hash is calculated when generating an Address however the hash itself is not currently available
2015-01-08 19:17:51 -05:00
Braydon Fuller 8b505f0cfa Fixed tests to handle a `defaultNetwork` change
- Updated tests to work for both 'testnet' and 'livenet' as the default network.
- Fixed a bug in Address where the network property was being set as a string.
- Fixed a bug in HDKeys to handle serialized keys when the defaultNetwork changed.
2015-01-06 18:51:31 -05:00
Braydon Fuller d2a2be7a93 Upgraded bn.js to fix public key calculation problem, restored crypto/point.js, and added additional tests. 2015-01-04 09:19:08 -05:00
Braydon Fuller 3de6acc176 Add tests that reveals incorrect public key calculation 2015-01-03 13:20:51 -05:00
Esteban Ordano 901d836231 Add default network to PublicKey
Closes #871
2014-12-31 02:20:47 -03:00
Esteban Ordano 4980f7a646 Test coverage: last branch untested from PublicKey 2014-12-19 16:44:49 -03:00
Esteban Ordano 36e87d8822 PrivateKey, PublicKey, Network linted
* Added 100% test coverage for them also
2014-12-19 16:18:05 -03:00
Braydon Fuller e3fa89ce62 PublicKey: Fix formatting issue for inspect 2014-12-16 12:25:01 -05:00
Yemel Jardi 428bcaf4c9 Remove compressed argument from private key and public key constructors 2014-12-15 14:48:17 -03:00
Braydon Fuller c0bbf96dc1 Keys: Added toObject method and changed toJSON to return a string 2014-12-12 18:47:15 -05:00
Braydon Fuller 4ddf3d117c Keys: Modified and added standardized toJSON/fromJSON prototypes 2014-12-12 13:39:49 -05:00
Esteban Ordano 0c28bc1786 Split buildPKH arguments, add Copy constructor on publickey 2014-12-10 12:46:21 -03:00
Braydon Fuller ae80ca8678 PublicKey: Add test to verify that both uncompressed an compressed keys validatate. Fixes #665 2014-12-04 12:47:59 -05:00
Braydon Fuller d5d88287cd Networks: Consistency of network reference for 'livenet', and removed hardcoded value. 2014-12-02 10:48:21 -05:00
Braydon Fuller b06866f86f PublicKey: Added toAddress prototype. Closes #599 2014-12-01 14:15:59 -05:00
Braydon Fuller 9a76bf30ff Crypto/Point: Added test coverage and documentation, and refactored validation 2014-12-01 10:14:36 -05:00
Braydon Fuller 85ce140aeb Keys: Renamed Privkey to PrivateKey and Pubkey to PublicKey 2014-11-25 13:21:53 -05:00