Braydon Fuller
809ff1461e
Restore error when trying to derive a hardened path with HDPublicKey.
- Restores InvalidIndexCantDeriveHardened error in spec
- Passes hardened argument in HDPublicKey (in case the feature is attempted to be used similarly to HDPrivateKey)
- Fixes undefined error with InvalidLength
- Fixes tests to check for the error type
- Various formatting cleanup improvements
10 years ago
Braydon Fuller
8ff26bb260
Fixes for various formatting issues and typos.
10 years ago
David de Kloet
b1e54101d3
Call the parent error of the fee errors FeeError for backwards compatibility.
10 years ago
David de Kloet
8da9c4a44a
Give the 3 fee errors a common parent error.
10 years ago
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.
10 years ago
Braydon Fuller
f8ea7e39cc
Included satoshis check during checked serialization.
10 years ago
Manuel Araoz
3619c7c9e2
fix problematic cases
10 years ago
Manuel Araoz
62ea45a524
refactor Address<->Script relation
10 years ago
eordano
294ff097a1
Add error if shuffle function doesnt return an expected result
10 years ago
Manuel Araoz
d5fd3919c9
add Transaction#inputAmount and outputAmount
10 years ago
eordano
c5d7eacfac
Add check for output amount > input amount
10 years ago
eordano
a6df7a175e
Better granularity on serialize() checks
10 years ago
Manuel Araoz
8ca396c34f
refactor transaction input deserializtion
10 years ago
Esteban Ordano
7cf3b6eb91
Split setLockTime in two methods
10 years ago
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 "
10 years ago
Esteban Ordano
979d284567
Transaction: add `removeInput` member
10 years ago
Manuel Araoz
b37a8d2f32
new version of extend
10 years ago
Manuel Araoz
f2eeb7664e
fix extend
10 years ago
Manuel Araoz
149b7fafed
new error system with no code generation
10 years ago
Esteban Ordano
0f73c3f7a3
Throw error if dust amount is detected
10 years ago
Esteban Ordano
dbf47ef78f
transaction: better errors for signature methods
Closes #868
10 years ago
Yemel Jardi
e7839d9ba2
Add from/to Fiat methods to Unit class
10 years ago
Esteban Ordano
a379876e0b
Delete lint errors from autogenerated file
10 years ago
Esteban Ordano
be599e5a1b
Review Unit class
* Add 100% code coverage
* Add custom error code
* Linted source and test
* More descriptive test messages
10 years ago
Esteban Ordano
9a73338c91
Add tests for changes to Transaction interface
10 years ago
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`
10 years ago
Esteban Ordano
d4b8c4adc6
Remove globals
10 years ago
Esteban Ordano
1b19255fd1
Fix #756 : Preconditions Invalid Argument
10 years ago
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
10 years ago
Esteban Ordano
af43228daf
Add `PublicKeyHashInput` and `ScriptHashInput`.
Remove `_outpoints`, `_utxos` from Transaction, as that info
can be efficiently retrieved from the inputs
10 years ago
Esteban Ordano
0c28bc1786
Split buildPKH arguments, add Copy constructor on publickey
10 years ago
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)")
```
10 years ago
Esteban Ordano
d29d8d267d
Add message to stack
10 years ago
Esteban Ordano
121b9fc090
Fixes issues with errors
10 years ago
Esteban Ordano
13fd2592fc
Add autogenerated errors
10 years ago