merge Script/scripts
This commit is contained in:
parent
151386c46d
commit
e2abe2b3af
14 changed files with 365 additions and 403 deletions
test
|
@ -9,10 +9,10 @@ var Block = Bitcoin.Block
|
|||
var ECPair = Bitcoin.ECPair
|
||||
var ECSignature = Bitcoin.ECSignature
|
||||
var Transaction = Bitcoin.Transaction
|
||||
var Script = Bitcoin.Script
|
||||
|
||||
var bufferutils = Bitcoin.bufferutils
|
||||
var networks = Bitcoin.networks
|
||||
var scripts = Bitcoin.scripts
|
||||
|
||||
var base58_encode_decode = require('./fixtures/core/base58_encode_decode.json')
|
||||
var base58_keys_invalid = require('./fixtures/core/base58_keys_invalid.json')
|
||||
|
@ -172,7 +172,7 @@ describe('Bitcoin-core', function () {
|
|||
})
|
||||
})
|
||||
|
||||
describe('Script.fromASM', function () {
|
||||
describe('scripts.fromASM', function () {
|
||||
tx_valid.forEach(function (f) {
|
||||
// Objects that are only a single string are ignored
|
||||
if (f.length === 1) return
|
||||
|
@ -195,7 +195,7 @@ describe('Bitcoin-core', function () {
|
|||
|
||||
it('can parse ' + prevOutScriptPubKey, function () {
|
||||
// TODO: we can probably do better validation than this
|
||||
Script.fromASM(prevOutScriptPubKey)
|
||||
scripts.fromASM(prevOutScriptPubKey)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -228,8 +228,8 @@ describe('Bitcoin-core', function () {
|
|||
assert.strictEqual(transaction.toHex(), txHex)
|
||||
|
||||
var script = new Buffer(scriptHex, 'hex')
|
||||
var scriptChunks = Script.decompile(script)
|
||||
assert.strictEqual(Script.compile(scriptChunks).toString('hex'), scriptHex)
|
||||
var scriptChunks = scripts.decompile(script)
|
||||
assert.strictEqual(scripts.compile(scriptChunks).toString('hex'), scriptHex)
|
||||
|
||||
var hash = transaction.hashForSignature(inIndex, script, hashType)
|
||||
assert.deepEqual(hash, expectedHash)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue