diff --git a/bitcore.js b/bitcore.js
index 551a834..89eeef3 100644
--- a/bitcore.js
+++ b/bitcore.js
@@ -7,7 +7,14 @@ module.exports.bignum = require('bignum');
module.exports.base58 = require('base58-native');
module.exports.EncodedData = require('./util/EncodedData');
module.exports.VersionedData = require('./util/VersionedData');
-module.exports.Address= require('./Address');
+module.exports.Address = require('./Address');
+module.exports.config = require('./config');
+module.exports.log = require('./util/log');
+module.exports.Opcode = require('./Opcode');
+module.exports.util = require('./util/util');
+module.exports.Script = require('./Script');
+module.exports.SINKey = require('./SINKey');
+//module.exports.Transaction = require('./Transaction');
if (typeof process.versions === 'undefined') {
diff --git a/browser/vendor_load.js b/browser/vendor_load.js
index 9a4251f..4e97483 100644
--- a/browser/vendor_load.js
+++ b/browser/vendor_load.js
@@ -1,5 +1,5 @@
// load modules needed for testing in the browser
-var fs = require('fs');
+//var fs = require('fs');
diff --git a/sin-test.js b/sin-test.js
deleted file mode 100644
index df00923..0000000
--- a/sin-test.js
+++ /dev/null
@@ -1,7 +0,0 @@
-
-var SINKey = require('./SINKey').class();
-
-var sk = new SINKey();
-sk.generate();
-console.dir(sk.storeObj());
-
diff --git a/test/index.html b/test/index.html
index 0d62a92..8cf9a0f 100644
--- a/test/index.html
+++ b/test/index.html
@@ -20,6 +20,9 @@
+
+
+
diff --git a/test/test.Address.js b/test/test.Address.js
index ec0787b..5713cf5 100644
--- a/test/test.Address.js
+++ b/test/test.Address.js
@@ -16,14 +16,14 @@ describe('Address', function() {
Address = AddressModule.class();
should.exist(Address);
});
- it('should be able to create Address object', function() {
+ it('should be able to create instance', function() {
var a = new Address('1KfyjCgBSMsLqiCbakfSdeoBUqMqLUiu3T');
should.exist(a);
});
it('should validate correctly', function() {
- var a = new Address("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa");
- var m = new Address("32QBdjycLwbDTuGafUwaU5p5GxzSLPYoF6");
- var b = new Address("11111111111111111111111111122222234");
+ var a = new Address('1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa');
+ var m = new Address('32QBdjycLwbDTuGafUwaU5p5GxzSLPYoF6');
+ var b = new Address('11111111111111111111111111122222234');
a.validate.bind(a).should.not.throw(Error);
m.validate.bind(m).should.not.throw(Error);
b.validate.bind(b).should.throw(Error);
diff --git a/test/test.Opcode.js b/test/test.Opcode.js
new file mode 100644
index 0000000..fa78f5e
--- /dev/null
+++ b/test/test.Opcode.js
@@ -0,0 +1,43 @@
+'use strict';
+
+var chai = require('chai');
+var bitcore = require('../bitcore');
+
+var should = chai.should();
+
+var OpcodeModule = bitcore.Opcode;
+var Opcode;
+
+describe('Opcode', function() {
+ it('should initialze the main object', function() {
+ should.exist(OpcodeModule);
+ });
+ it('should be able to create class', function() {
+ Opcode = OpcodeModule.class();
+ should.exist(Opcode);
+ });
+ it('should be able to create instance', function() {
+ var oc = new Opcode();
+ should.exist(oc);
+ });
+ it.skip('should be able to create some constants', function() {
+ // TODO: test works in node but not in browser
+ for (var i in Opcode.map) {
+ console.log('var '+i + ' = ' + Opcode.map[i] + ';');
+ eval('var '+i + ' = ' + Opcode.map[i] + ';');
+ console.log(eval(i));
+ }
+ should.exist(OP_VER);
+ should.exist(OP_HASH160);
+ should.exist(OP_RETURN);
+ should.exist(OP_EQUALVERIFY);
+ should.exist(OP_CHECKSIG);
+ should.exist(OP_CHECKMULTISIG);
+
+ });
+});
+
+
+
+
+
diff --git a/test/test.SIN.js b/test/test.SIN.js
new file mode 100644
index 0000000..469c318
--- /dev/null
+++ b/test/test.SIN.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.Script.js b/test/test.Script.js
new file mode 100644
index 0000000..31e8523
--- /dev/null
+++ b/test/test.Script.js
@@ -0,0 +1,40 @@
+'use strict';
+
+var chai = require('chai');
+var bitcore = require('../bitcore');
+
+var should = chai.should();
+
+var ScriptModule = bitcore.Script;
+var Address = bitcore.Address.class();
+var Script;
+
+describe('Script', function() {
+ it('should initialze the main object', function() {
+ should.exist(ScriptModule);
+ });
+ it('should be able to create class', function() {
+ Script = ScriptModule.class();
+ should.exist(Script);
+ });
+ it('should be able to create instance', function() {
+ var s = new Script();
+ should.exist(s);
+ });
+ it('should be able to create Script from Address', function() {
+ var addr = new Address('1J57QmkaQ6JohJoQyaUJwngJ2vTQ3C6gHi');
+ var script = Script.createPubKeyHashOut(addr.payload());
+ should.exist(script);
+ script.isPubkeyHash().should.be.true;
+ });
+ it('isP2SH should work', function() {
+ var addr = new Address('1J57QmkaQ6JohJoQyaUJwngJ2vTQ3C6gHi');
+ var script = Script.createPubKeyHashOut(addr.payload());
+ script.isP2SH().should.be.false;
+ });
+});
+
+
+
+
+
diff --git a/test/test.Transaction.js b/test/test.Transaction.js
new file mode 100644
index 0000000..02da04a
--- /dev/null
+++ b/test/test.Transaction.js
@@ -0,0 +1,28 @@
+'use strict';
+
+var chai = require('chai');
+var bitcore = require('../bitcore');
+
+var should = chai.should();
+
+var TransactionModule = bitcore.Transaction;
+var Transaction;
+
+describe.skip('Transaction', function() {
+ it('should initialze the main object', function() {
+ should.exist(TransactionModule);
+ });
+ it('should be able to create class', function() {
+ Transaction = TransactionModule.class();
+ should.exist(Transaction);
+ });
+ it('should be able to create instance', function() {
+ var t = new Transaction();
+ should.exist(t);
+ });
+});
+
+
+
+
+
diff --git a/test/test.misc.js b/test/test.misc.js
new file mode 100644
index 0000000..ab4364a
--- /dev/null
+++ b/test/test.misc.js
@@ -0,0 +1,24 @@
+'use strict';
+
+var chai = require('chai');
+var bitcore = require('../bitcore');
+
+var should = chai.should();
+
+describe('Miscelaneous stuff', function() {
+ it('should initialze the config object', function() {
+ should.exist(bitcore.config);
+ });
+ it('should initialze the log object', function() {
+ should.exist(bitcore.log);
+ });
+ it('should initialze the util object', function() {
+ should.exist(bitcore.util);
+ });
+
+});
+
+
+
+
+
diff --git a/util/util.js b/util/util.js
index f12a38f..5568610 100644
--- a/util/util.js
+++ b/util/util.js
@@ -1,4 +1,5 @@
-require('buffertools');
+'use strict';
+
var crypto = require('crypto');
var bignum = require('bignum');
var Binary = require('binary');
@@ -327,7 +328,8 @@ var varStrBuf = exports.varStrBuf = function varStrBuf(s) {
exports.NULL_HASH = new Buffer(32).fill(0);
exports.EMPTY_BUFFER = new Buffer(0);
exports.ZERO_VALUE = new Buffer(8).fill(0);
-INT64_MAX = new Buffer('ffffffffffffffff', 'hex');
+var INT64_MAX = new Buffer('ffffffffffffffff', 'hex');
+exports.INT64_MAX = INT64_MAX;
// How much of Bitcoin's internal integer coin representation
// makes 1 BTC