Commit Graph

80 Commits

Author SHA1 Message Date
ethers 7353511da3 make ripe160 preconditions be consistent like the other hashing functions 2014-07-26 20:51:06 -07:00
Ryan X. Charles 71f181efee add tests to EncodedData and fix hex conversion bug
...making sure the new changes to __proto__ are working correctly.
2014-07-15 18:21:38 -07:00
Ryan X. Charles cfa0c11983 remove replace deprecated setting of __proto__ in error.js 2014-07-15 18:04:25 -07:00
Ryan X. Charles 9122807ecb remove __proto__ from EncodedData and family
EncodedData was setting "converter" and "_encoding" by setting them on the
prototype of the object. This was probably done to enable overriding these
functions. However, overriding was never actually used anywhere, and setting
the __proto__ is deprecated. So I have remove all instances of setting
__proto__ for EncodedData-ish classes, and instead just set "convert" and
"_encoding" on the object directly.
2014-07-15 17:14:04 -07:00
Ryan X. Charles 86da48a25d replace a deprecated use of setting __proto__ 2014-07-15 15:59:19 -07:00
Linus Unnebäck 3da6fe899f cleanup after removal of soop
Removed some unnecessary parenthesise that hung around after the merge
of #417
2014-07-12 12:14:56 +02:00
Ryan X. Charles dbaeb044e7 remove commented-out code 2014-07-10 18:51:43 -07:00
Ryan X. Charles b504b0b4d1 simplify use of bignum in util 2014-07-10 18:49:04 -07:00
Ryan X. Charles af1d754bd8 make bignum interface backwards compatible
- fix cmp, mul, div, add, mod, sub functions to take numbers and strings
- fix Point class to use common folder correctly
2014-07-10 18:14:13 -07:00
Ryan X. Charles 98bf58463e remove cryptojs dependency from util
...use hash.js, which is already required by elliptic
2014-07-10 16:22:42 -07:00
Ryan X. Charles c8fe404402 replace bignumber.js with bn.js 2014-07-10 16:20:13 -07:00
Manuel Araoz 0e2df698cd fix SIN and add tests 2014-07-10 17:17:24 -03:00
Manuel Araoz 557e9ae2a4 use node util.inherits 2014-07-10 15:55:32 -03:00
Ryan X. Charles ca67786a77 ran js-beautify on all bitcore source
js-beautify -s 2 -r *.js

...did not run on bundles, only on source.
2014-06-23 10:57:02 -07:00
Matias Alejo Garcia d751ed8a57 adds the BIT constant 2014-06-11 18:15:17 -03:00
Ryan X. Charles 338158ca46 fix sjcl issue on npm install
...by including sjcl locally
2014-06-06 11:49:58 -07:00
Ryan X. Charles a242112e66 replace jssha with sjcl - remove jssha dependency 2014-06-04 18:13:32 -07:00
Ryan X. Charles e963ff3c45 add ECIES support in node - not browser 2014-06-02 20:15:58 -07:00
olalonde 78ae388553 Replace process.versions tests by browserify's package.json browser field. Fixes #329 2014-05-07 14:14:10 +08:00
Ryan X. Charles 7f348ca0bd Move BigNumber to internal
...no longer relies on Manuel's repo hostig a version of "bignum" that actually
contained bignumber.js. This moves bignumber.js internally and removes bignum
from the browser build process. Also adds a bitcore.Bignum that links to the
right thing. In node, browser.Bignum is require('bignum'). And in the browser,
bitcore.Bignum is is now Bignumber.js (same as before ... except bignumber.js
is now inside bitcore).
2014-04-28 18:00:59 -04:00
Ryan X. Charles ba692aaa20 add new SecureRandom class that does the right thing
Generating random numbers properly depends on the platform. The new
getRandomBuffer method does the right thing on the right platform. It will
sometimes fail due to insufficient entropy. The getPseudoRandomBuffer class is
also provided that will never fail, but it is not cryptographically secure and
should not be used for keys.
2014-04-22 22:18:59 -03:00
Eric Martindale 198b811290 Add missing util/index.js 2014-04-16 14:35:07 -04:00
Ruben de Vries 9c6c300289 fixed calcDifficulty by making sure the MAX_TARGET is also locally available.
added tests for 2 difficulty calculations.
2014-04-08 10:26:36 +02:00
Manuel Araoz 2c331cb2ef some hashForSignature tests passing! :D 2014-04-03 15:55:54 -03:00
Ryan X. Charles ba59d97a73 make things work in the browser by fixing sha512
...had to use jsSHA package to do SHA512 in the browser. Unfortunately it is
quite slow compared to node.
2014-03-22 16:16:58 -07:00
Ryan X. Charles fa47ee9984 Merge remote-tracking branch 'matiu/feature/Block-test'
Conflicts:
	util/util.js
2014-03-21 14:57:45 -07:00
Matias Alejo Garcia 227a95296b remove stracktrace for firefox error reporting 2014-03-21 18:00:13 -03:00
Matias Alejo Garcia 684be77268 small fixes in block, adapt to browser bignum. remove legacy code 2014-03-21 16:39:38 -03:00
Manuel Araoz 1c1bb068b8 fix util problem 2014-03-21 12:13:24 -07:00
Manuel Araoz ba92a6b1df refactor and fixes for Transaction, ScriptInterpreter, and Key 2014-03-21 12:13:23 -07:00
Manuel Araoz cfe899ee76 fix Transaction#create tests 2014-03-19 13:16:01 -03:00
Manuel Araoz 856225d377 fix for firefox 2014-03-19 12:26:36 -03:00
Manuel Araoz 9ef8b78182 refactor int conversion, encoding, and utils 2014-03-19 12:26:36 -03:00
Manuel Araoz 5505491e8d fix negative number arithmetic! 2014-03-19 12:26:36 -03:00
Manuel Araoz 19e15f91ca size tests working!!! :D 2014-03-19 12:26:36 -03:00
Matias Alejo Garcia 671d372c19 tx creation working. more tests needed 2014-03-15 03:27:06 -03:00
Ryan X. Charles c565d6207c Merge pull request #140 from matiu/bug/fix-ripe160-and-address
Bug/fix ripe160 and address
2014-03-12 18:03:40 -04:00
Matias Alejo Garcia 0f8ee57521 refactor ripe160 binding 2014-03-12 15:34:19 -03:00
Manuel Araoz 1732ec2ced add new example 2014-03-12 15:22:56 -03:00
Matias Alejo Garcia dc8d23dba5 fix conflicts 2014-03-12 11:56:10 -03:00
Matias Alejo Garcia ab183c0e66 fixes ripe160 add some tests 2014-03-12 11:40:10 -03:00
Manuel Araoz 18b2d190de change vendor.js to vendor-bundle.js 2014-03-11 15:29:06 -03:00
Manuel Araoz 76cf42506c refactoring browser code 2014-03-11 12:32:38 -03:00
Ryan X. Charles cb00efb092 Merge remote-tracking branch 'maraoz/feature/add-bitcoin-core-tests'
Conflicts:
	Script.js
	ScriptInterpreter.js

...fixed conflicts in Script.js and ScriptInterpreter.js. Many tests are broken
right now, but that's because we're now including more test data in the tests.
These need to be fixed.
2014-03-09 12:07:11 -04:00
Ryan X. Charles c19fb7a3ce Merge remote-tracking branch 'matiu/feature/support-soop-browser'
Conflicts:
	Script.js
	ScriptInterpreter.js
	Transaction.js
	test/testdata.js

...conflicts resolved by taking Manuel's changes, and then manually including
Matias's changes on those same files. The conflicts resulted from differences
in indentation, which is because Matias' changes unindendented all the code
that had been but is not now inside a function.
2014-03-08 19:30:21 -05:00
Manuel Araoz dc56cb8d45 fixed Script parse tests for all scripts (valid and invalid) 2014-03-07 15:41:27 -03:00
Mike Belshe cda6d035b4 * Fix size bug in bitcore's getVarIntSize.
* Implement quadword for varIntBuf
* Add unit tests for util.varIntBuf and util.getVarIntSize
* Fix the browser/util numToVarInt equivalent as well
2014-03-06 22:01:22 -08:00
Manuel Araoz 05c5538162 script parser code added and tested 2014-03-06 17:23:00 -03:00
Matias Alejo Garcia c05181e412 fix error in versioned data 2014-03-05 17:37:16 -03:00
Matias Alejo Garcia 6d9a396d89 fix error in versioned data 2014-03-05 17:36:52 -03:00