Commit Graph

24 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
Patrick Nagurny 0dec8e7bd8 Merge pull request #1294 from braydonf/tx-unmodified-arguments
Objects passed as arguments are unmodified.
2015-07-30 10:16:00 -04:00
Braydon Fuller d9047eebf0 Detect if scriptSig (input) or scriptPubKey (output) is previously known. 2015-07-09 11:30:20 -04:00
Braydon Fuller 3d1dc7aafe Objects passed as arguments are unmodified. 2015-07-06 19:32:34 -04:00
Braydon Fuller b5ada707bd Benchmarks for block serialization & 4x performance improvement. 2015-06-24 21:19:34 -04:00
Braydon Fuller 458abe069e Fixed issue with handling invalid output scripts
- Changed toObject serialization to always use a hexa string for a script
- Updated inspect method to handle a null script
- Roundtrip toObject/fromObject with an invalid script
- Additional test coverage for Output
2015-05-14 01:50:14 -04:00
Braydon Fuller beeb294e45 Merge pull request #1217 from fanatid/fix/writeable
fix typo: defineProperty.writeable
2015-05-13 09:22:56 -04:00
Patrick Nagurny de078a40d3 If output.script is InvalidBuffer, return null instead of throwing error 2015-05-12 17:23:56 -04:00
Kirill Fomichev 346b2af446 delete writable for accessor property 2015-05-10 23:55:55 +03:00
Braydon Fuller f8ea7e39cc Included satoshis check during checked serialization. 2015-04-30 13:23:44 -04:00
Braydon Fuller 3d447ded79 Update bn.js to 2.0.4 to handle 53 bit precision number input. 2015-04-30 11:20:09 -04:00
Braydon Fuller bcd4efb724 Added `checkState` for positive integer in Output satoshis 2015-04-10 18:39:08 -04:00
Manuel Araoz b92fd915eb increase coverage for Input and Output, fix some bugs 2015-02-27 18:46:27 -03:00
Esteban Ordano 614a228c79 Allow satoshis to be a string on output creation 2015-01-28 12:02:41 -03:00
Esteban Ordano bdeac4e67d Add inspect method to output 2015-01-09 16:53:50 -03:00
Yemel Jardi e57d02c03c Use define immutable helper 2015-01-08 10:57:46 -03:00
Braydon Fuller bce28cd227 Fixed bug in IE11 that would cause MAX_MONEY verification test to fail. 2015-01-06 12:00:28 -05:00
Manuel Araoz 370f69df88 refactor BN and ECDSA 2014-12-19 17:23:53 -03:00
Esteban Ordano 9a73338c91 Add tests for changes to Transaction interface 2014-12-18 20:38:19 -03:00
Braydon Fuller 6f6d568661 Transaction: toNumber/fromNumber to set satoshis 2014-12-13 15:10:51 -05:00
Braydon Fuller ad4bc9324f Transaction: Use Script toString for transaction JSON output 2014-12-13 14:54:07 -05:00
Braydon Fuller b544b0594d Added test to check that Transaction fromJSON could initialize from toJSON, and fixed a bug. 2014-12-13 14:54:07 -05:00
Braydon Fuller 002eb3dcf5 Transaction: Added toObject method and changed toJSON to return a string 2014-12-12 19:03:14 -05:00
Esteban Ordano 5c974a8ef2 Refactor transaction to match new API
* Refactor transaction into a different subfolder
* Added a lot of tests for sighash and transaction serialization (from
  reddit's and Ryan X. Charles' `fullnode`)
* Drop "only" from sighash tests and consolidate logs
2014-12-10 12:44:30 -03:00