Merge pull request from bitcoinjs/standard

standard: remove padded Blocks
This commit is contained in:
Daniel Cousens 2015-09-05 14:14:17 +10:00
commit cc503bb873
6 changed files with 2 additions and 12 deletions

View file

@ -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)

View file

@ -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

View file

@ -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))
} }

View file

@ -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)
} }

View file

@ -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)
} }

View file

@ -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)
} }