Jeff Garzik
68a79e3454
lib/util/preconditions: Directly use Buffer.isBuffer (Cordova, RN workaround)
Using "./buffer" fails on some browserify-esque platforms
such as Cordova and React.Native.
Fixes #108
8 years ago
Esteban Ordano
19f3fe0de3
Using buffer-compare instead of copy&paste
9 years ago
Esteban Ordano
026f878e51
Add tests for bip69 from bitcoinjs
9 years ago
Braydon Fuller
805182c500
Removed readReverse() precondition for a 2x block parsing improvement.
10 years ago
Braydon Fuller
3d447ded79
Update bn.js to 2.0.4 to handle 53 bit precision number input.
10 years ago
Braydon Fuller
3005e19cbf
Added precondition to transaction.to for a positive integer as an amount
10 years ago
eordano
0938eadab5
Add precondition checks to HDPrivateKey.from*
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
69b466470a
HDKeys: Return a copy buffer instead of the original instance
10 years ago
Braydon Fuller
a1ee393dce
JSUtil: Return result quicker for isValidJSON and add additional tests.
10 years ago
Braydon Fuller
c20a0eabed
Check type of parsed JSON to determine it's an object and not a number.
10 years ago
Esteban Ordano
476f009b4d
Add Insight and UTXO class
10 years ago
Esteban Ordano
12cac0e33d
Fix tests on browsers: need to add Buffer exception
10 years ago
Esteban Ordano
afb5b6971f
Add tests for bufferutils
10 years ago
Esteban Ordano
d4b8c4adc6
Remove globals
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
Braydon Fuller
94cc10b1a3
Changed *Json to *JSON and returned an object so that methods can be called from other toJSON methods without the double-stringification issue.
10 years ago
Braydon Fuller
c73c56f938
HDKeys: Modified to have immutable properties
10 years ago
Yemel Jardi
ee169a80af
Replace buffertools
10 years ago
Yemel Jardi
68f50b2f61
Add messages serialization
10 years ago
Yemel Jardi
f1d2009418
Add transport/connection class
10 years ago
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
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
3551742fee
Miscelaneus updates to docs and bufferreader/writer
10 years ago
Esteban Ordano
a2a51ecc0c
Fix style: move each static function to an appropiate namespace
10 years ago