Commit Graph

182 Commits

Author SHA1 Message Date
Braydon Fuller 6d42e01718 Fix formatting issue with examples 2014-12-18 17:07:01 -05: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 24dc84d614 Dont lose sighash when signing with multiple keys 2014-12-18 02:19:39 -03:00
Esteban Ordano a352937566 Fix transaction order 2014-12-18 01:42:45 -03:00
Esteban Ordano 6be0c047b7 Update index for the documentation 2014-12-17 17:40:15 -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
Esteban Ordano ce8927690f Add count for missing signatures 2014-12-16 22:30:13 -03:00
Manuel Araoz b3be9461cf tx_valid tests passing! 2014-12-16 18:47:58 -03:00
Esteban Ordano d4b8c4adc6 Remove globals 2014-12-16 17:30:43 -03:00
Esteban Ordano ed9a9f6da9 Fix wrong jsdocs 2014-12-16 17:21:41 -03:00
Manuel Araoz 4fcc048311 script interpreting working 2014-12-16 13:33:57 -03:00
Manuel Araoz 49192a1ed7 style change to BufferUtil 2014-12-16 13:33:57 -03:00
Manuel Araoz ddd11e908c all script_valid tests passing! 2014-12-16 13:33:56 -03:00
Manuel Araoz 0ddec23c02 fix some more tests 2014-12-16 13:33:56 -03:00
Manuel Araoz a761ac91c2 some more passing tests 2014-12-16 13:33:56 -03:00
Manuel Araoz 73874ae873 import Sighash 2014-12-16 13:33:56 -03:00
Manuel Araoz 9aa6152f25 trying to fix OP_CHECKSIG script evaluation 2014-12-16 13:33:56 -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 1535805f1c Add PublicKeyHashInput class 2014-12-15 18:19:39 -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
Manuel Aráoz 264a239e5a Merge pull request #737 from braydonf/bug/to-object
Transaction:  `toJSON` / `fromJSON` tests
2014-12-15 17:06:08 -03:00
Braydon Fuller b13c4fb0c9 Added inspect prototype G5 2014-12-14 15:13:01 -05: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 f43c2f9aa3 Fixed bug, toObject should use other object's toObject 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
Esteban Ordano 0c28bc1786 Split buildPKH arguments, add Copy constructor on publickey 2014-12-10 12:46:21 -03: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