Commit Graph

4 Commits

Author SHA1 Message Date
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 12cac0e33d Fix tests on browsers: need to add Buffer exception 2014-12-17 12:38:56 -03:00
Esteban Ordano afb5b6971f Add tests for bufferutils 2014-12-17 12:10:02 -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