Commit Graph

34 Commits

Author SHA1 Message Date
David de Kloet
b1e54101d3 Call the parent error of the fee errors FeeError for backwards compatibility. 2015-05-10 00:38:56 +02:00
David de Kloet
8da9c4a44a Give the 3 fee errors a common parent error. 2015-05-10 00:32:27 +02:00
David de Kloet
d1eb190626 Introduce different kinds of FeeError to distinguish the different cases. Fix the issue uncovered by this, which is that getFee might not be the actual fee, but only an estimate, if a change address is specified but there isn't enough to pay a fee and have change. 2015-05-09 21:06:40 +02:00
Braydon Fuller
f8ea7e39cc Included satoshis check during checked serialization. 2015-04-30 13:23:44 -04:00
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
b37a8d2f32 new version of extend 2015-01-13 20:18:28 -03:00
Manuel Araoz
f2eeb7664e fix extend 2015-01-13 20:11:40 -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
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