Commit Graph

22 Commits

Author SHA1 Message Date
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
Kirill Fomichev 346b2af446 delete writable for accessor property 2015-05-10 23:55:55 +03:00
Manuel Araoz d556a0c33d fix regressions 2015-04-29 18:55:42 -03:00
Manuel Araoz dfc075e5d1 fix block parsing problem 2015-04-29 17:29:33 -03:00
Manuel Araoz dff0891871 add failing test for Block#toObject 2015-04-28 15:17:41 -03:00
Manuel Araoz b92fd915eb increase coverage for Input and Output, fix some bugs 2015-02-27 18:46:27 -03:00
Manuel Araoz aa1158097d fix bug in change calculation 2015-02-10 18:12:45 -03:00
Esteban Ordano 4781c4328f Better error message on unsupported input types 2015-02-06 10:14:41 -03:00
Manuel Araoz c664f211d2 add BufferReader.readVarLengthBuffer 2015-02-04 13:04:55 -03:00
Yemel Jardi e57d02c03c Use define immutable helper 2015-01-08 10:57:46 -03:00
Esteban Ordano 9a73338c91 Add tests for changes to Transaction interface 2014-12-18 20:38:19 -03:00
Esteban Ordano e5631b1a69 Modify transaction interface
* Add checks when serializing
* Add default _estimateSize to generic inputs
* Fix multisig size estimation
* Change _addOutput to addOutput
* Add addInput and using that internally
* Split `getFee` out from `_updateChangeOutput`
2014-12-18 14:09:44 -03:00
Esteban Ordano 9f442e8ec4 Merge pull request #777 from maraoz/add/tx_invalid/tests
add tx_invalid.json tests
2014-12-16 23:13:59 -03:00
Manuel Araoz 84deec297a add tx_invalid tests 2014-12-16 22:40:59 -03:00
Esteban Ordano f7f7d147c6 Add change features 2014-12-16 22:39:25 -03:00
Manuel Araoz 49192a1ed7 style change to BufferUtil 2014-12-16 13:33:57 -03:00
Esteban Ordano de4d2884c7 Modify Transaction to use Multisig
* Allow `Script#add` to add a Script causing concatenation of opcodes
* Add `Script#equals` to compare scripts
* Add `Script#fromAddress`
* Drop `_payTo` methods
* Add `Script.buildP2SHMultisigIn`

Greatly simplifying the internal transaction object
2014-12-15 18:19:54 -03:00
Esteban Ordano af43228daf Add `PublicKeyHashInput` and `ScriptHashInput`.
Remove `_outpoints`, `_utxos` from Transaction, as that info
can be efficiently retrieved from the inputs
2014-12-15 18:19:39 -03: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 ef49dda0fd Move input to subfolder before refactor
Gonna inherit from it on two subclasses: "P2SH Input" and "P2PKH Input"

They'll have a `addSignature` method, to deal with new signatures,
a `clearSignatures`, in case the outputs change and the signatures get
invalidated, `countMissingSignatures`, and a reference to the UTXO
they'll be spending, so all logic regarding "p2sh mapping" gets to
be in here and the Transaction class is not polluted.
2014-12-11 09:18:20 -03:00