From ed90a2ebe6575372dd7da3d3574a1c0123c5532a Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Wed, 19 Feb 2014 12:48:35 -0300 Subject: [PATCH 1/5] Browserify Bloom --- bitcore.js | 1 + test/index.html | 1 + test/test.Bloom.js | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 test/test.Bloom.js diff --git a/bitcore.js b/bitcore.js index 145ee39..ac10d13 100644 --- a/bitcore.js +++ b/bitcore.js @@ -20,6 +20,7 @@ module.exports.Peer = require('./Peer'); module.exports.Block = require('./Block'); module.exports.Connection = require('./Connection'); module.exports.ScriptInterpreter = require('./ScriptInterpreter'); +module.exports.Bloom = require('./Bloom'); if (typeof process.versions === 'undefined') { diff --git a/test/index.html b/test/index.html index 008a49c..2276744 100644 --- a/test/index.html +++ b/test/index.html @@ -27,6 +27,7 @@ + - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/test/test.Key.js b/test/test.Key.js new file mode 100644 index 0000000..a8d4982 --- /dev/null +++ b/test/test.Key.js @@ -0,0 +1,23 @@ +'use strict'; + +var chai = require('chai'); +var bitcore = require('../bitcore'); + +var should = chai.should(); + +var Key = bitcore.Key; + +describe.skip('Key', function() { + it('should initialze the main object', function() { + should.exist(Key); + }); + it('should be able to create instance', function() { + var k = new Key(); + should.exist(k); + }); +}); + + + + + diff --git a/test/test.PeerManager.js b/test/test.PeerManager.js new file mode 100644 index 0000000..fc36379 --- /dev/null +++ b/test/test.PeerManager.js @@ -0,0 +1,37 @@ +'use strict'; + +var chai = require('chai'); +var bitcore = require('../bitcore'); + +var should = chai.should(); + +var PeerManagerModule = bitcore.PeerManager; +var PeerManager; + +describe('PeerManager', function() { + it('should initialze the main object', function() { + should.exist(PeerManagerModule); + }); + it('should be able to create class', function() { + PeerManager = PeerManagerModule.class(); + should.exist(PeerManager); + }); + it('should be able to create instance', function() { + var pm = new PeerManager(); + should.exist(pm); + }); + it('should be able to start instance', function() { + var pm = new PeerManager(); + pm.start.bind(pm).should.not.throw(); + }); + it('should be able to stop instance', function() { + var pm = new PeerManager(); + pm.start(); + pm.stop.bind(pm).should.not.throw(); + }); +}); + + + + + diff --git a/test/test.PrivateKey.js b/test/test.PrivateKey.js new file mode 100644 index 0000000..b7ab9c3 --- /dev/null +++ b/test/test.PrivateKey.js @@ -0,0 +1,28 @@ +'use strict'; + +var chai = require('chai'); +var bitcore = require('../bitcore'); + +var should = chai.should(); + +var PrivateKeyModule = bitcore.PrivateKey; +var PrivateKey; + +describe('PrivateKey', function() { + it('should initialze the main object', function() { + should.exist(PrivateKeyModule); + }); + it('should be able to create class', function() { + PrivateKey = PrivateKeyModule.class(); + should.exist(PrivateKey); + }); + it('should be able to create instance', function() { + var pk = new PrivateKey(); + should.exist(pk); + }); +}); + + + + + diff --git a/test/test.RpcClient.js b/test/test.RpcClient.js new file mode 100644 index 0000000..cbc795a --- /dev/null +++ b/test/test.RpcClient.js @@ -0,0 +1,28 @@ +'use strict'; + +var chai = require('chai'); +var bitcore = require('../bitcore'); + +var should = chai.should(); + +var RpcClientModule = bitcore.RpcClient; +var RpcClient; + RpcClient = RpcClientModule.class(); + +describe('RpcClient', function() { + it('should initialze the main object', function() { + should.exist(RpcClientModule); + }); + it('should be able to create class', function() { + should.exist(RpcClient); + }); + it('should be able to create instance', function() { + var s = new RpcClient(); + should.exist(s); + }); +}); + + + + + diff --git a/test/test.SIN.js b/test/test.SIN.js index 469c318..12c32fc 100644 --- a/test/test.SIN.js +++ b/test/test.SIN.js @@ -1,30 +1,28 @@ 'use strict'; - - var chai = require('chai'); var bitcore = require('../bitcore'); var should = chai.should(); -var SINKeyModule = bitcore.SINKey; -var SINKey; +var SINModule = bitcore.SIN; +var SIN; - -describe('SINKey', function() { +describe('SIN', function() { it('should initialze the main object', function() { - should.exist(SINKeyModule); + should.exist(SINModule); }); it('should be able to create class', function() { - SINKey = SINKeyModule.class(); - should.exist(SINKey); + SIN = SINModule.class(); + should.exist(SIN); }); it('should be able to create instance', function() { - var sk = new SINKey(); - sk.generate(); - should.exist(sk.created); - should.exist(sk.privKey.private); - should.exist(sk.privKey.public); - should.exist(sk.privKey.compressed); + var s = new SIN(); + should.exist(s); }); }); + + + + + diff --git a/test/test.SINKey.js b/test/test.SINKey.js new file mode 100644 index 0000000..469c318 --- /dev/null +++ b/test/test.SINKey.js @@ -0,0 +1,30 @@ +'use strict'; + + + +var chai = require('chai'); +var bitcore = require('../bitcore'); + +var should = chai.should(); + +var SINKeyModule = bitcore.SINKey; +var SINKey; + + +describe('SINKey', function() { + it('should initialze the main object', function() { + should.exist(SINKeyModule); + }); + it('should be able to create class', function() { + SINKey = SINKeyModule.class(); + should.exist(SINKey); + }); + it('should be able to create instance', function() { + var sk = new SINKey(); + sk.generate(); + should.exist(sk.created); + should.exist(sk.privKey.private); + should.exist(sk.privKey.public); + should.exist(sk.privKey.compressed); + }); +}); diff --git a/test/test.Wallet.js b/test/test.Wallet.js new file mode 100644 index 0000000..906603e --- /dev/null +++ b/test/test.Wallet.js @@ -0,0 +1,28 @@ +'use strict'; + +var chai = require('chai'); +var bitcore = require('../bitcore'); + +var should = chai.should(); + +var WalletModule = bitcore.Wallet; +var Wallet; + +describe('Wallet', function() { + it('should initialze the main object', function() { + should.exist(WalletModule); + }); + it('should be able to create class', function() { + Wallet = WalletModule.class(); + should.exist(Wallet); + }); + it('should be able to create instance', function() { + var s = new Wallet(); + should.exist(s); + }); +}); + + + + + diff --git a/test/test.WalletKey.js b/test/test.WalletKey.js new file mode 100644 index 0000000..9d127ec --- /dev/null +++ b/test/test.WalletKey.js @@ -0,0 +1,31 @@ +'use strict'; + +var chai = require('chai'); +var bitcore = require('../bitcore'); + +var should = chai.should(); + +var WalletKeyModule = bitcore.WalletKey; +var networks = bitcore.networks; +var WalletKey; + +describe('WalletKey', function() { + it('should initialze the main object', function() { + should.exist(WalletKeyModule); + }); + it('should be able to create class', function() { + WalletKey = WalletKeyModule.class(); + should.exist(WalletKey); + }); + it('should be able to create instance', function() { + var s = new WalletKey({ + network: networks.livenet + }); + should.exist(s); + }); +}); + + + + +