From f0a4aebdfb8088bc21bd95c2feca3261c465a1c6 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Thu, 20 Nov 2014 18:08:31 -0300 Subject: [PATCH] reorder tests --- index.js | 2 +- lib/crypto/ecdsa.js | 6 +++--- lib/crypto/kdf.js | 6 +++--- lib/transaction.js | 2 +- test/{ => crypto}/bn.js | 0 test/{ => crypto}/ecdsa.js | 0 test/{ => crypto}/hash.js | 0 test/{ => crypto}/kdf.js | 0 test/{ => crypto}/point.js | 0 test/{ => crypto}/random.js | 0 test/{ => protocol}/base58.js | 0 test/{ => protocol}/base58check.js | 0 test/{ => protocol}/bufferreader.js | 0 test/{ => protocol}/bufferwriter.js | 0 test/protocol/constants.js | 18 ++++++++++++++++++ test/{ => protocol}/varint.js | 0 16 files changed, 26 insertions(+), 8 deletions(-) rename test/{ => crypto}/bn.js (100%) rename test/{ => crypto}/ecdsa.js (100%) rename test/{ => crypto}/hash.js (100%) rename test/{ => crypto}/kdf.js (100%) rename test/{ => crypto}/point.js (100%) rename test/{ => crypto}/random.js (100%) rename test/{ => protocol}/base58.js (100%) rename test/{ => protocol}/base58check.js (100%) rename test/{ => protocol}/bufferreader.js (100%) rename test/{ => protocol}/bufferwriter.js (100%) create mode 100644 test/protocol/constants.js rename test/{ => protocol}/varint.js (100%) diff --git a/index.js b/index.js index 929d6ac..757dd21 100644 --- a/index.js +++ b/index.js @@ -6,6 +6,7 @@ bitcore.Base58 = require('./lib/protocol/base58'); bitcore.Base58Check = require('./lib/protocol/base58check'); bitcore.BufferReader = require('./lib/protocol/bufferreader'); bitcore.BufferWriter = require('./lib/protocol/bufferwriter'); +bitcore.Varint = require('./lib/protocol/varint'); // crypto bitcore.BN = require('./lib/crypto/bn'); @@ -29,7 +30,6 @@ bitcore.Signature = require('./lib/signature'); bitcore.Transaction = require('./lib/transaction'); bitcore.Txin = require('./lib/txin'); bitcore.Txout = require('./lib/txout'); -bitcore.Varint = require('./lib/varint'); //dependencies, subject to change diff --git a/lib/crypto/ecdsa.js b/lib/crypto/ecdsa.js index c56302d..d68f82d 100644 --- a/lib/crypto/ecdsa.js +++ b/lib/crypto/ecdsa.js @@ -2,10 +2,10 @@ var BN = require('./bn'); var Point = require('./point'); -var Signature = require('./signature'); -var Keypair = require('./keypair'); -var Pubkey = require('./pubkey'); var Random = require('./random'); +var Pubkey = require('../pubkey'); +var Keypair = require('../keypair'); +var Signature = require('../signature'); var ECDSA = function ECDSA(obj) { if (!(this instanceof ECDSA)) diff --git a/lib/crypto/kdf.js b/lib/crypto/kdf.js index 4e2c872..afbbbea 100644 --- a/lib/crypto/kdf.js +++ b/lib/crypto/kdf.js @@ -1,13 +1,13 @@ 'use strict'; var Bn = require('./bn'); -var Privkey = require('./privkey'); var Point = require('./point'); -var Keypair = require('./keypair'); var Hash = require('./hash'); +var Privkey = require('../privkey'); +var Keypair = require('../keypair'); function KDF() { -}; +} KDF.buf2keypair = function(buf) { return KDF.sha256hmac2keypair(buf); diff --git a/lib/transaction.js b/lib/transaction.js index 0f64d85..4959b8f 100644 --- a/lib/transaction.js +++ b/lib/transaction.js @@ -3,7 +3,7 @@ var BufferWriter = require('./protocol/bufferwriter'); var BufferReader = require('./protocol/bufferreader'); var Varint = require('./protocol/varint'); -var Hash = require('./cryptohash'); +var Hash = require('./crypto/hash'); var Txin = require('./txin'); var Txout = require('./txout'); diff --git a/test/bn.js b/test/crypto/bn.js similarity index 100% rename from test/bn.js rename to test/crypto/bn.js diff --git a/test/ecdsa.js b/test/crypto/ecdsa.js similarity index 100% rename from test/ecdsa.js rename to test/crypto/ecdsa.js diff --git a/test/hash.js b/test/crypto/hash.js similarity index 100% rename from test/hash.js rename to test/crypto/hash.js diff --git a/test/kdf.js b/test/crypto/kdf.js similarity index 100% rename from test/kdf.js rename to test/crypto/kdf.js diff --git a/test/point.js b/test/crypto/point.js similarity index 100% rename from test/point.js rename to test/crypto/point.js diff --git a/test/random.js b/test/crypto/random.js similarity index 100% rename from test/random.js rename to test/crypto/random.js diff --git a/test/base58.js b/test/protocol/base58.js similarity index 100% rename from test/base58.js rename to test/protocol/base58.js diff --git a/test/base58check.js b/test/protocol/base58check.js similarity index 100% rename from test/base58check.js rename to test/protocol/base58check.js diff --git a/test/bufferreader.js b/test/protocol/bufferreader.js similarity index 100% rename from test/bufferreader.js rename to test/protocol/bufferreader.js diff --git a/test/bufferwriter.js b/test/protocol/bufferwriter.js similarity index 100% rename from test/bufferwriter.js rename to test/protocol/bufferwriter.js diff --git a/test/protocol/constants.js b/test/protocol/constants.js new file mode 100644 index 0000000..e5604d5 --- /dev/null +++ b/test/protocol/constants.js @@ -0,0 +1,18 @@ +'use strict'; + +var should = require('chai').should(); +var bitcore = require('../../'); +var constants = bitcore.Constants; + +describe('Constants', function() { + + it('should contain all constants for livenet and testnet', function() { + for (var key in constants.livenet) { + if (constants.livenet.hasOwnProperty(key)) { + constants.testnet.hasOwnProperty(key).should.equal(true); + } + } + + }); + +}); diff --git a/test/varint.js b/test/protocol/varint.js similarity index 100% rename from test/varint.js rename to test/protocol/varint.js