Merge pull request #453 from bitcoinjs/standard
standard: remove padded Blocks
This commit is contained in:
commit
cc503bb873
6 changed files with 2 additions and 12 deletions
|
@ -28,7 +28,6 @@ function ECPair (d, Q, options) {
|
||||||
if (Q) throw new TypeError('Unexpected publicKey parameter')
|
if (Q) throw new TypeError('Unexpected publicKey parameter')
|
||||||
|
|
||||||
this.d = d
|
this.d = d
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
typeforce(types.ECPoint, Q)
|
typeforce(types.ECPoint, Q)
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,6 @@ Transaction.prototype.hashForSignature = function (inIndex, prevOutScript, hashT
|
||||||
input.sequence = 0
|
input.sequence = 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
} else if ((hashType & 0x1f) === Transaction.SIGHASH_SINGLE) {
|
} else if ((hashType & 0x1f) === Transaction.SIGHASH_SINGLE) {
|
||||||
var nOut = inIndex
|
var nOut = inIndex
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,6 @@ describe('ecdsa', function () {
|
||||||
var signature
|
var signature
|
||||||
if (f.signature) {
|
if (f.signature) {
|
||||||
signature = ECSignature.fromDER(new Buffer(f.signature, 'hex'))
|
signature = ECSignature.fromDER(new Buffer(f.signature, 'hex'))
|
||||||
|
|
||||||
} else if (f.signatureRaw) {
|
} else if (f.signatureRaw) {
|
||||||
signature = new ECSignature(new BigInteger(f.signatureRaw.r, 16), new BigInteger(f.signatureRaw.s, 16))
|
signature = new ECSignature(new BigInteger(f.signatureRaw.r, 16), new BigInteger(f.signatureRaw.s, 16))
|
||||||
}
|
}
|
||||||
|
|
|
@ -323,7 +323,6 @@ describe('script', function () {
|
||||||
|
|
||||||
if (f.scriptSig) {
|
if (f.scriptSig) {
|
||||||
assert.strictEqual(bscript.toASM(scriptSig), f.scriptSig)
|
assert.strictEqual(bscript.toASM(scriptSig), f.scriptSig)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
assert.strictEqual(scriptSig.toString('hex'), f.scriptSigHex)
|
assert.strictEqual(scriptSig.toString('hex'), f.scriptSigHex)
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@ describe('Transaction', function () {
|
||||||
|
|
||||||
if (txIn.data) {
|
if (txIn.data) {
|
||||||
scriptSig = new Buffer(txIn.data, 'hex')
|
scriptSig = new Buffer(txIn.data, 'hex')
|
||||||
|
|
||||||
} else if (txIn.script) {
|
} else if (txIn.script) {
|
||||||
scriptSig = bscript.fromASM(txIn.script)
|
scriptSig = bscript.fromASM(txIn.script)
|
||||||
}
|
}
|
||||||
|
@ -31,9 +30,7 @@ describe('Transaction', function () {
|
||||||
var script
|
var script
|
||||||
|
|
||||||
if (txOut.data) {
|
if (txOut.data) {
|
||||||
var data = new Buffer(txOut.data, 'hex')
|
script = new Buffer(txOut.data, 'hex')
|
||||||
script = data
|
|
||||||
|
|
||||||
} else if (txOut.script) {
|
} else if (txOut.script) {
|
||||||
script = bscript.fromASM(txOut.script)
|
script = bscript.fromASM(txOut.script)
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,7 +203,6 @@ describe('TransactionBuilder', function () {
|
||||||
|
|
||||||
if (!sign.throws) {
|
if (!sign.throws) {
|
||||||
txb.sign(index, keyPair, redeemScript, sign.hashType)
|
txb.sign(index, keyPair, redeemScript, sign.hashType)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
assert.throws(function () {
|
assert.throws(function () {
|
||||||
txb.sign(index, keyPair, redeemScript, sign.hashType)
|
txb.sign(index, keyPair, redeemScript, sign.hashType)
|
||||||
|
@ -229,9 +228,7 @@ describe('TransactionBuilder', function () {
|
||||||
describe('for ' + (f.description || f.exception), function () {
|
describe('for ' + (f.description || f.exception), function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
if (f.txHex) {
|
if (f.txHex) {
|
||||||
var tx = Transaction.fromHex(f.txHex)
|
txb = TransactionBuilder.fromTransaction(Transaction.fromHex(f.txHex))
|
||||||
txb = TransactionBuilder.fromTransaction(tx)
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
txb = construct(f)
|
txb = construct(f)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue