@ -398,22 +398,20 @@ describe('Transaction', function() {
} ) . to . throw ( errors . Transaction . InvalidOutputAmountSum ) ;
} ) . to . throw ( errors . Transaction . InvalidOutputAmountSum ) ;
} ) ;
} ) ;
describe ( 'skipping checks' , function ( ) {
describe ( 'skipping checks' , function ( ) {
var buildSkipTest = function ( builder , check , expectedError , opts ) {
var buildSkipTest = function ( builder , check , expectedError ) {
return function ( ) {
return function ( ) {
var transaction = new Transaction ( ) ;
var transaction = new Transaction ( ) ;
transaction . from ( simpleUtxoWith1BTC ) ;
transaction . from ( simpleUtxoWith1BTC ) ;
builder ( transaction ) ;
builder ( transaction ) ;
var options = opts || { } ;
var options = { } ;
options [ check ] = true ;
options [ check ] = true ;
expect ( function ( ) {
expect ( function ( ) {
return transaction . serialize ( options ) ;
return transaction . serialize ( options ) ;
} ) . not . to . throw ( ) ;
} ) . not . to . throw ( ) ;
options [ check ] = false ;
expect ( function ( ) {
expect ( function ( ) {
return transaction . serialize ( options ) ;
return transaction . serialize ( ) ;
} ) . to . throw ( expectedError ) ;
} ) . to . throw ( expectedError ) ;
} ;
} ;
} ;
} ;
@ -452,13 +450,9 @@ describe('Transaction', function() {
function ( transaction ) {
function ( transaction ) {
return transaction
return transaction
. to ( toAddress , 10000000000000 )
. to ( toAddress , 10000000000000 )
. change ( changeAddress ) ;
. change ( changeAddress )
} , 'disableMoreOutputThanInput' ,
. sign ( privateKey ) ;
errors . Transaction . InvalidOutputAmountSum ,
} , 'disableMoreOutputThanInput' , errors . Transaction . InvalidOutputAmountSum
{
'disableSmallFees' : true ,
'disableIsFullySigned' : true
}
) ) ;
) ) ;
} ) ;
} ) ;
} ) ;
} ) ;