@ -748,6 +748,36 @@ describe('Transaction', function() {
return new Transaction ( ) . lockUntilBlockHeight ( - 1 ) ;
return new Transaction ( ) . lockUntilBlockHeight ( - 1 ) ;
} ) . to . throw ( errors . Transaction . NLockTimeOutOfRange ) ;
} ) . to . throw ( errors . Transaction . NLockTimeOutOfRange ) ;
} ) ;
} ) ;
it ( 'has a non-max sequenceNumber for effective date locktime tx' , function ( ) {
var transaction = new Transaction ( )
. from ( simpleUtxoWith1BTC )
. lockUntilDate ( date ) ;
expect ( transaction . inputs [ 0 ] . sequenceNumber
. should . not . equal ( Transaction . Input . DEFAULT_SEQNUMBER ) ) ;
} ) ;
it ( 'has a non-max sequenceNumber for effective blockheight locktime tx' , function ( ) {
var transaction = new Transaction ( )
. from ( simpleUtxoWith1BTC )
. lockUntilBlockHeight ( blockHeight ) ;
expect ( transaction . inputs [ 0 ] . sequenceNumber
. should . not . equal ( Transaction . Input . DEFAULT_SEQNUMBER ) ) ;
} ) ;
it ( 'should serialize correctly for date locktime ' , function ( ) {
var transaction = new Transaction ( )
. from ( simpleUtxoWith1BTC )
. lockUntilDate ( date ) ;
var serialized_tx = transaction . uncheckedSerialize ( ) ;
var copy = new Transaction ( serialized_tx ) ;
expect ( serialized_tx . should . equal ( copy . uncheckedSerialize ( ) ) ) ;
} ) ;
it ( 'should serialize correctly for a block height locktime' , function ( ) {
var transaction = new Transaction ( )
. from ( simpleUtxoWith1BTC )
. lockUntilBlockHeight ( blockHeight ) ;
var serialized_tx = transaction . uncheckedSerialize ( ) ;
var copy = new Transaction ( serialized_tx ) ;
expect ( serialized_tx . should . equal ( copy . uncheckedSerialize ( ) ) ) ;
} ) ;
} ) ;
} ) ;
it ( 'handles anyone-can-spend utxo' , function ( ) {
it ( 'handles anyone-can-spend utxo' , function ( ) {