|
|
@ -6,15 +6,18 @@ var base58check = require('bs58check') |
|
|
|
|
|
|
|
var Bitcoin = require('../') |
|
|
|
var Address = Bitcoin.Address |
|
|
|
var networks = Bitcoin.networks |
|
|
|
var Block = Bitcoin.Block |
|
|
|
var ECKey = Bitcoin.ECKey |
|
|
|
var ECSignature = Bitcoin.ECSignature |
|
|
|
var Transaction = Bitcoin.Transaction |
|
|
|
var Script = Bitcoin.Script |
|
|
|
|
|
|
|
var networks = Bitcoin.networks |
|
|
|
|
|
|
|
var base58_encode_decode = require('./fixtures/core/base58_encode_decode.json') |
|
|
|
var base58_keys_invalid = require('./fixtures/core/base58_keys_invalid.json') |
|
|
|
var base58_keys_valid = require('./fixtures/core/base58_keys_valid.json') |
|
|
|
var blocks_valid = require('./fixtures/core/blocks.json') |
|
|
|
var sig_canonical = require('./fixtures/core/sig_canonical.json') |
|
|
|
var sig_noncanonical = require('./fixtures/core/sig_noncanonical.json') |
|
|
|
var sighash = require('./fixtures/core/sighash.json') |
|
|
@ -134,6 +137,17 @@ describe('Bitcoin-core', function () { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
describe('Block', function () { |
|
|
|
blocks_valid.forEach(function (f) { |
|
|
|
it('fromHex can parse ' + f.id, function () { |
|
|
|
var block = Block.fromHex(f.hex) |
|
|
|
|
|
|
|
assert.equal(block.getId(), f.id) |
|
|
|
assert.equal(block.transactions.length, f.transactions) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
// tx_valid
|
|
|
|
describe('Transaction', function () { |
|
|
|
tx_valid.forEach(function (f) { |
|
|
|