You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
785 B
31 lines
785 B
10 years ago
|
'use strict';
|
||
|
|
||
|
var Transaction = require('../../lib/transaction');
|
||
|
|
||
|
var vectors_valid = require('./tx_valid.json');
|
||
|
var vectors_invalid = require('./tx_invalid.json');
|
||
|
|
||
|
describe('Transaction deserialization', function() {
|
||
|
|
||
|
describe('valid transaction test case', function() {
|
||
|
var index = 0;
|
||
|
vectors_valid.forEach(function(vector) {
|
||
|
if (vector.length > 1) {
|
||
|
var hexa = vector[1];
|
||
|
Transaction(hexa).serialize().should.equal(hexa);
|
||
|
index++;
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
describe('invalid transaction test case', function() {
|
||
|
var index = 0;
|
||
|
vectors_invalid.forEach(function(vector) {
|
||
|
if (vector.length > 1) {
|
||
|
var hexa = vector[1];
|
||
|
Transaction(hexa).serialize().should.equal(hexa);
|
||
|
index++;
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|