Browse Source

Merge pull request #1245 from maraoz/reorg-tests

reorganize block test files
patch-2
Braydon Fuller 10 years ago
parent
commit
001f71d1bf
  1. 8
      test/block/block.js
  2. 6
      test/block/blockheader.js
  3. 6
      test/block/merkleblock.js

8
test/block.js → test/block/block.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
var bitcore = require('..'); var bitcore = require('../..');
var BN = require('../lib/crypto/bn'); var BN = require('../../lib/crypto/bn');
var BufferReader = bitcore.encoding.BufferReader; var BufferReader = bitcore.encoding.BufferReader;
var BufferWriter = bitcore.encoding.BufferWriter; var BufferWriter = bitcore.encoding.BufferWriter;
var BlockHeader = bitcore.BlockHeader; var BlockHeader = bitcore.BlockHeader;
@ -15,8 +15,8 @@ var Transaction = bitcore.Transaction;
var dataRawBlockBuffer = fs.readFileSync('test/data/blk86756-testnet.dat'); var dataRawBlockBuffer = fs.readFileSync('test/data/blk86756-testnet.dat');
var dataRawBlockBinary = fs.readFileSync('test/data/blk86756-testnet.dat', 'binary'); var dataRawBlockBinary = fs.readFileSync('test/data/blk86756-testnet.dat', 'binary');
var dataJson = fs.readFileSync('test/data/blk86756-testnet.json').toString(); var dataJson = fs.readFileSync('test/data/blk86756-testnet.json').toString();
var data = require('./data/blk86756-testnet'); var data = require('../data/blk86756-testnet');
var dataBlocks = require('./data/bitcoind/blocks'); var dataBlocks = require('../data/bitcoind/blocks');
describe('Block', function() { describe('Block', function() {

6
test/blockheader.js → test/block/blockheader.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
var bitcore = require('..'); var bitcore = require('../..');
var BN = require('../lib/crypto/bn'); var BN = require('../../lib/crypto/bn');
var BufferReader = bitcore.encoding.BufferReader; var BufferReader = bitcore.encoding.BufferReader;
var BufferWriter = bitcore.encoding.BufferWriter; var BufferWriter = bitcore.encoding.BufferWriter;
@ -13,7 +13,7 @@ var should = require('chai').should();
var dataRawBlockBuffer = fs.readFileSync('test/data/blk86756-testnet.dat'); var dataRawBlockBuffer = fs.readFileSync('test/data/blk86756-testnet.dat');
var dataRawBlockBinary = fs.readFileSync('test/data/blk86756-testnet.dat', 'binary'); var dataRawBlockBinary = fs.readFileSync('test/data/blk86756-testnet.dat', 'binary');
var dataRawId = '000000000b99b16390660d79fcc138d2ad0c89a0d044c4201a02bdf1f61ffa11'; var dataRawId = '000000000b99b16390660d79fcc138d2ad0c89a0d044c4201a02bdf1f61ffa11';
var data = require('./data/blk86756-testnet'); var data = require('../data/blk86756-testnet');
describe('BlockHeader', function() { describe('BlockHeader', function() {

6
test/merkleblock.js → test/block/merkleblock.js

@ -2,13 +2,13 @@
var should = require('chai').should(); var should = require('chai').should();
var bitcore = require('..'); var bitcore = require('../..');
var MerkleBlock = bitcore.MerkleBlock; var MerkleBlock = bitcore.MerkleBlock;
var BufferReader = bitcore.encoding.BufferReader; var BufferReader = bitcore.encoding.BufferReader;
var BufferWriter = bitcore.encoding.BufferWriter; var BufferWriter = bitcore.encoding.BufferWriter;
var Transaction = bitcore.Transaction; var Transaction = bitcore.Transaction;
var data = require('./data/merkleblocks.js'); var data = require('../data/merkleblocks.js');
var transactionVector = require('./data/tx_creation'); var transactionVector = require('../data/tx_creation');
describe('MerkleBlock', function() { describe('MerkleBlock', function() {
Loading…
Cancel
Save