Script: fixes pubKeyInput and adds a test
This commit is contained in:
parent
9d5d18b2d8
commit
b68b1d5da4
3 changed files with 27 additions and 6 deletions
test
|
@ -52,12 +52,24 @@ describe('Scripts', function() {
|
|||
|
||||
// FIXME: bad
|
||||
describe('pay-to-pubkey', function() {
|
||||
it('matches the test data', function() {
|
||||
var f = fixtures.valid[0]
|
||||
var pubKey = ECPubKey.fromHex(f.pubKey)
|
||||
var script = scripts.pubKeyOutput(pubKey)
|
||||
describe('input', function() {
|
||||
it('matches the test data', function() {
|
||||
var f = fixtures.valid[4]
|
||||
var signature = new Buffer(f.signature, 'hex')
|
||||
var script = scripts.pubKeyInput(signature)
|
||||
|
||||
assert.equal(script.toHex(), f.hex)
|
||||
assert.equal(script.toHex(), f.hex)
|
||||
})
|
||||
})
|
||||
|
||||
describe('output', function() {
|
||||
it('matches the test data', function() {
|
||||
var f = fixtures.valid[0]
|
||||
var pubKey = ECPubKey.fromHex(f.pubKey)
|
||||
var script = scripts.pubKeyOutput(pubKey)
|
||||
|
||||
assert.equal(script.toHex(), f.hex)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue