Commit Graph

14 Commits

Author SHA1 Message Date
Manuel Aráoz b69997711b Merge pull request #823 from eordano/review/jsdoc-unit
Review Unit class
2014-12-19 15:27:55 -03:00
Esteban Ordano a379876e0b Delete lint errors from autogenerated file 2014-12-19 14:21:48 -03:00
Esteban Ordano be599e5a1b Review Unit class
* Add 100% code coverage
* Add custom error code
* Linted source and test
* More descriptive test messages
2014-12-19 13:18:22 -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 d4b8c4adc6 Remove globals 2014-12-16 17:30:43 -03:00
Esteban Ordano 1b19255fd1 Fix #756: Preconditions Invalid Argument 2014-12-16 13:52:25 -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
Esteban Ordano 0c28bc1786 Split buildPKH arguments, add Copy constructor on publickey 2014-12-10 12:46:21 -03: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 d29d8d267d Add message to stack 2014-12-03 11:49:33 -03:00
Esteban Ordano 121b9fc090 Fixes issues with errors 2014-12-03 10:06:44 -03:00
Esteban Ordano 13fd2592fc Add autogenerated errors 2014-11-30 09:47:44 -03:00