junderw
6 years ago
No known key found for this signature in database
GPG Key ID: B256185D3A971908
4 changed files with
14 additions and
20 deletions
-
src/templates/multisig/input.ts
-
src/templates/pubkey/index.ts
-
src/templates/pubkey/input.ts
-
src/templates/pubkey/output.ts
|
|
@ -3,8 +3,8 @@ |
|
|
|
import * as bscript from '../../script' |
|
|
|
const OPS = require('bitcoin-ops') |
|
|
|
|
|
|
|
function partialSignature (value) { |
|
|
|
return value === OPS.OP_0 || bscript.isCanonicalScriptSignature(value) |
|
|
|
function partialSignature (value: number | Buffer): boolean { |
|
|
|
return value === OPS.OP_0 || bscript.isCanonicalScriptSignature(<Buffer>value) |
|
|
|
} |
|
|
|
|
|
|
|
export function check (script: Buffer | Array<number | Buffer>, allowIncomplete?: boolean): boolean { |
|
|
|
|
|
@ -1,5 +1,7 @@ |
|
|
|
module.exports = { |
|
|
|
input: require('./input'), |
|
|
|
output: require('./output') |
|
|
|
import * as input from './input' |
|
|
|
import * as output from './output' |
|
|
|
|
|
|
|
export { |
|
|
|
input, |
|
|
|
output, |
|
|
|
} |
|
|
|
export {} |
|
|
|
|
|
@ -1,16 +1,11 @@ |
|
|
|
// {signature}
|
|
|
|
|
|
|
|
const bscript = require('../../script') |
|
|
|
import * as bscript from '../../script' |
|
|
|
|
|
|
|
function check (script) { |
|
|
|
export function check (script: Buffer | Array<number | Buffer>): boolean { |
|
|
|
const chunks = bscript.decompile(script) |
|
|
|
|
|
|
|
return chunks.length === 1 && |
|
|
|
bscript.isCanonicalScriptSignature(chunks[0]) |
|
|
|
bscript.isCanonicalScriptSignature(<Buffer>chunks[0]) |
|
|
|
} |
|
|
|
check.toJSON = function () { return 'pubKey input' } |
|
|
|
|
|
|
|
module.exports = { |
|
|
|
check: check |
|
|
|
} |
|
|
|
export {} |
|
|
|
|
|
@ -1,16 +1,13 @@ |
|
|
|
// {pubKey} OP_CHECKSIG
|
|
|
|
|
|
|
|
const bscript = require('../../script') |
|
|
|
import * as bscript from '../../script' |
|
|
|
const OPS = require('bitcoin-ops') |
|
|
|
|
|
|
|
function check (script) { |
|
|
|
export function check (script: Buffer | Array<number | Buffer>): boolean { |
|
|
|
const chunks = bscript.decompile(script) |
|
|
|
|
|
|
|
return chunks.length === 2 && |
|
|
|
bscript.isCanonicalPubKey(chunks[0]) && |
|
|
|
bscript.isCanonicalPubKey(<Buffer>chunks[0]) && |
|
|
|
chunks[1] === OPS.OP_CHECKSIG |
|
|
|
} |
|
|
|
check.toJSON = function () { return 'pubKey output' } |
|
|
|
|
|
|
|
module.exports = { check } |
|
|
|
export {} |
|
|
|