Manuel Araoz
3619c7c9e2
fix problematic cases
2015-03-18 17:40:26 -03:00
Manuel Araoz
62ea45a524
refactor Address<->Script relation
2015-03-18 16:54:16 -03:00
eordano
294ff097a1
Add error if shuffle function doesnt return an expected result
2015-03-11 15:49:42 -03:00
Manuel Araoz
d5fd3919c9
add Transaction#inputAmount and outputAmount
2015-02-27 16:38:48 -03:00
eordano
c5d7eacfac
Add check for output amount > input amount
2015-02-24 16:34:52 -03:00
eordano
a6df7a175e
Better granularity on serialize() checks
2015-02-24 13:02:34 -03:00
Manuel Araoz
8ca396c34f
refactor transaction input deserializtion
2015-02-11 11:40:24 -03:00
Esteban Ordano
7cf3b6eb91
Split setLockTime in two methods
2015-02-10 10:29:29 -03:00
Braydon Fuller
904df59493
Added docs link to InvalidArgument message for preconditions.
...
- Error messages will appear as: "Invalid Argument: First argument is required, please include address data. Documentation: http://bitcore.io/guide/address.html "
2015-02-09 21:46:10 -05:00
Esteban Ordano
979d284567
Transaction: add `removeInput` member
2015-02-04 17:53:16 -03:00
Manuel Araoz
149b7fafed
new error system with no code generation
2015-01-13 19:02:16 -03:00
Esteban Ordano
0f73c3f7a3
Throw error if dust amount is detected
2015-01-08 18:02:59 -03:00
Esteban Ordano
dbf47ef78f
transaction: better errors for signature methods
...
Closes #868
2014-12-31 02:10:51 -03:00
Yemel Jardi
e7839d9ba2
Add from/to Fiat methods to Unit class
2014-12-25 19:04:03 -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
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
13fd2592fc
Add autogenerated errors
2014-11-30 09:47:44 -03:00