Comparing version 0.13.1 to 0.13.2
{ | ||
"name": "bitcore", | ||
"main": "./bitcore.min.js", | ||
"version": "0.13.1", | ||
"version": "0.13.2", | ||
"homepage": "http://bitcore.io", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -16,2 +16,3 @@ 'use strict'; | ||
var DEFAULT_SEQNUMBER = 0xFFFFFFFF; | ||
var DEFAULT_LOCKTIME_SEQNUMBER = 0x00000000; | ||
@@ -28,2 +29,3 @@ function Input(params) { | ||
Input.DEFAULT_SEQNUMBER = DEFAULT_SEQNUMBER; | ||
Input.DEFAULT_LOCKTIME_SEQNUMBER = DEFAULT_LOCKTIME_SEQNUMBER; | ||
@@ -30,0 +32,0 @@ Object.defineProperty(Input.prototype, 'script', { |
@@ -417,2 +417,9 @@ 'use strict'; | ||
} | ||
for (var i = 0; i < this.inputs.length; i++) { | ||
if (this.inputs[i].sequenceNumber === Input.DEFAULT_SEQNUMBER){ | ||
this.inputs[i].sequenceNumber = Input.DEFAULT_LOCKTIME_SEQNUMBER; | ||
} | ||
} | ||
this.nLockTime = time; | ||
@@ -437,2 +444,10 @@ return this; | ||
} | ||
for (var i = 0; i < this.inputs.length; i++) { | ||
if (this.inputs[i].sequenceNumber === Input.DEFAULT_SEQNUMBER){ | ||
this.inputs[i].sequenceNumber = Input.DEFAULT_LOCKTIME_SEQNUMBER; | ||
} | ||
} | ||
this.nLockTime = height; | ||
@@ -439,0 +454,0 @@ return this; |
{ | ||
"name": "bitcore", | ||
"version": "0.13.1", | ||
"version": "0.13.2", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "bn.js": { |
{ | ||
"name": "bitcore", | ||
"version": "0.13.1", | ||
"version": "0.13.2", | ||
"description": "A pure and powerful JavaScript Bitcoin library.", | ||
@@ -5,0 +5,0 @@ "author": "BitPay <dev@bitpay.com>", |
@@ -751,2 +751,36 @@ 'use strict'; | ||
}); | ||
it('has a non-max sequenceNumber for effective date locktime tx', function() { | ||
var transaction = new Transaction() | ||
.from(simpleUtxoWith1BTC) | ||
.lockUntilDate(date); | ||
transaction.inputs[0].sequenceNumber | ||
.should.equal(Transaction.Input.DEFAULT_LOCKTIME_SEQNUMBER); | ||
}); | ||
it('has a non-max sequenceNumber for effective blockheight locktime tx', function() { | ||
var transaction = new Transaction() | ||
.from(simpleUtxoWith1BTC) | ||
.lockUntilBlockHeight(blockHeight); | ||
transaction.inputs[0].sequenceNumber | ||
.should.equal(Transaction.Input.DEFAULT_LOCKTIME_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); | ||
serialized_tx.should.equal(copy.uncheckedSerialize()); | ||
copy.inputs[0].sequenceNumber | ||
.should.equal(Transaction.Input.DEFAULT_LOCKTIME_SEQNUMBER) | ||
}); | ||
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); | ||
serialized_tx.should.equal(copy.uncheckedSerialize()); | ||
copy.inputs[0].sequenceNumber | ||
.should.equal(Transaction.Input.DEFAULT_LOCKTIME_SEQNUMBER) | ||
}); | ||
}); | ||
@@ -753,0 +787,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2037515
25941