Skip to content

Commit

Permalink
tests/txb: fix bad BIP66 encoding (R = 0)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed May 22, 2018
1 parent 17ff77d commit 650c7eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/transaction_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,15 @@ describe('TransactionBuilder', function () {
it('supports the alternative abstract interface { publicKey, sign }', function () {
var keyPair = {
publicKey: Buffer.alloc(33, 0x03),
sign: function (hash) { return Buffer.alloc(64) }
sign: function (hash) { return Buffer.alloc(64, 0x5f) }
}

var txb = new TransactionBuilder()
txb.setVersion(1)
txb.addInput('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 1)
txb.addOutput('1111111111111111111114oLvT2', 100000)
txb.sign(0, keyPair)
assert.equal(txb.build().toHex(), '0100000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff010000002c0930060201000201000121030303030303030303030303030303030303030303030303030303030303030303ffffffff01a0860100000000001976a914000000000000000000000000000000000000000088ac00000000')
assert.equal(txb.build().toHex(), '0100000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff010000006a47304402205f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f02205f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f0121030303030303030303030303030303030303030303030303030303030303030303ffffffff01a0860100000000001976a914000000000000000000000000000000000000000088ac00000000')
})

fixtures.invalid.sign.forEach(function (f) {
Expand Down

0 comments on commit 650c7eb

Please sign in to comment.