move data extraction fof OP_PUSHDATA into main function.

This allows us to centralise the error checking to simplify things a bit.
This commit is contained in:
Owain G. Ainsworth 2014-03-14 20:59:43 +00:00
parent 02ee7762e4
commit 9375c8dc48
2 changed files with 124 additions and 146 deletions

View file

@ -421,26 +421,32 @@ func parseScriptTemplate(script []byte, opcodemap map[byte]*opcode) ([]parsedOpc
pop.data = script[i+1 : i+op.length]
i += op.length
case op.length < 0:
var err error
var l uint
off := i + 1
if len(script[off:]) < -op.length {
return retScript, StackErrShortScript
}
// Next -length bytes are little endian length of data.
switch op.length {
case -1:
l, err = scriptUInt8(script[off:])
l = uint(script[off])
case -2:
l, err = scriptUInt16(script[off:])
l = ((uint(script[off+1]) << 8) |
uint(script[off]))
case -4:
l, err = scriptUInt32(script[off:])
l = ((uint(script[off+3]) << 24) |
(uint(script[off+2]) << 16) |
(uint(script[off+1]) << 8) |
uint(script[off]))
default:
return retScript,
fmt.Errorf("invalid opcode length %d",
op.length)
}
if err != nil {
return nil, err
}
off = i + 1 - op.length // beginning of data
off += -op.length // beginning of data
// Disallow entries that do not fit script or were
// sign extended.
if int(l) > len(script[off:]) || int(l) < 0 {
@ -619,7 +625,7 @@ func (m *Script) Step() (done bool, err error) {
return true, err
}
if m.dstack.Depth() + m.astack.Depth() > maxStackSize {
if m.dstack.Depth()+m.astack.Depth() > maxStackSize {
return false, StackErrOverflow
}
@ -862,33 +868,6 @@ func calcScriptHash(script []parsedOpcode, hashType byte, tx *btcwire.MsgTx, idx
return btcwire.DoubleSha256(wbuf.Bytes())
}
// scriptUInt8 return the number stored in the first byte of a slice.
func scriptUInt8(script []byte) (uint, error) {
if len(script) < 1 {
return 0, StackErrShortScript
}
return uint(script[0]), nil
}
// scriptUInt16 returns the number stored in the next 2 bytes of a slice.
func scriptUInt16(script []byte) (uint, error) {
if len(script) < 2 {
return 0, StackErrShortScript
}
// Yes this is little endian
return ((uint(script[1]) << 8) | uint(script[0])), nil
}
// scriptUInt32 returns the number stored in the first 4 bytes of a slice.
func scriptUInt32(script []byte) (uint, error) {
if len(script) < 4 {
return 0, StackErrShortScript
}
// Yes this is little endian
return ((uint(script[3]) << 24) | (uint(script[2]) << 16) |
(uint(script[1]) << 8) | uint(script[0])), nil
}
// getStack returns the contents of stack as a byte array bottom up
func getStack(stack *Stack) [][]byte {
array := make([][]byte, stack.Depth())

View file

@ -1,171 +1,170 @@
github.com/conformal/btcscript/opcode.go opcodeCheckMultiSig 100.00% (62/62)
github.com/conformal/btcscript/script.go Script.Step 100.00% (38/38)
github.com/conformal/btcscript/script.go parseScriptTemplate 100.00% (30/30)
github.com/conformal/btcscript/opcode.go opcodeCheckMultiSig 100.00% (58/58)
github.com/conformal/btcscript/script.go parseScriptTemplate 100.00% (29/29)
github.com/conformal/btcscript/address.go ExtractPkScriptAddrs 100.00% (27/27)
github.com/conformal/btcscript/script.go CalcScriptInfo 100.00% (25/25)
github.com/conformal/btcscript/scriptbuilder.go ScriptBuilder.AddData 100.00% (24/24)
github.com/conformal/btcscript/stack.go asInt 100.00% (23/23)
github.com/conformal/btcscript/opcode.go parsedOpcode.bytes 100.00% (23/23)
github.com/conformal/btcscript/stack.go asInt 100.00% (21/21)
github.com/conformal/btcscript/script.go NewScript 100.00% (21/21)
github.com/conformal/btcscript/scriptbuilder.go ScriptBuilder.AddData 100.00% (22/22)
github.com/conformal/btcscript/opcode.go parsedOpcode.disabled 100.00% (17/17)
github.com/conformal/btcscript/opcode.go parsedOpcode.print 100.00% (16/16)
github.com/conformal/btcscript/stack.go Stack.nipN 100.00% (15/15)
github.com/conformal/btcscript/script.go signatureScriptCustomReader 100.00% (15/15)
github.com/conformal/btcscript/stack.go Stack.nipN 100.00% (15/15)
github.com/conformal/btcscript/stack.go fromInt 100.00% (14/14)
github.com/conformal/btcscript/script.go isMultiSig 100.00% (13/13)
github.com/conformal/btcscript/opcode.go opcodeWithin 100.00% (13/13)
github.com/conformal/btcscript/opcode.go parsedOpcode.exec 100.00% (13/13)
github.com/conformal/btcscript/script.go GetPreciseSigOpCount 100.00% (13/13)
github.com/conformal/btcscript/script.go PayToAddrScript 100.00% (11/11)
github.com/conformal/btcscript/script.go Script.CheckErrorCondition 100.00% (11/11)
github.com/conformal/btcscript/opcode.go opcodeWithin 100.00% (13/13)
github.com/conformal/btcscript/script.go isMultiSig 100.00% (13/13)
github.com/conformal/btcscript/opcode.go opcodeNotIf 100.00% (11/11)
github.com/conformal/btcscript/opcode.go opcodeIf 100.00% (11/11)
github.com/conformal/btcscript/script.go PayToAddrScript 100.00% (11/11)
github.com/conformal/btcscript/script.go typeOfScript 100.00% (11/11)
github.com/conformal/btcscript/opcode.go opcodeIf 100.00% (11/11)
github.com/conformal/btcscript/opcode.go opcodeMin 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeMax 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeBoolOr 100.00% (10/10)
github.com/conformal/btcscript/script.go getSigOpCount 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeNumEqual 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeBoolAnd 100.00% (10/10)
github.com/conformal/btcscript/stack.go Stack.Tuck 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeLessThanOrEqual 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeGreaterThan 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeLessThan 100.00% (10/10)
github.com/conformal/btcscript/script.go getSigOpCount 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeBoolAnd 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeBoolOr 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeNumEqual 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeNumNotEqual 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeLessThan 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeGreaterThan 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeLessThanOrEqual 100.00% (10/10)
github.com/conformal/btcscript/opcode.go opcodeGreaterThanOrEqual 100.00% (10/10)
github.com/conformal/btcscript/stack.go Stack.RotN 100.00% (9/9)
github.com/conformal/btcscript/opcode.go opcodeMax 100.00% (10/10)
github.com/conformal/btcscript/stack.go Stack.OverN 100.00% (9/9)
github.com/conformal/btcscript/stack.go Stack.SwapN 100.00% (9/9)
github.com/conformal/btcscript/stack.go Stack.RotN 100.00% (9/9)
github.com/conformal/btcscript/script.go Script.CheckErrorCondition 100.00% (9/9)
github.com/conformal/btcscript/script.go DisasmString 100.00% (9/9)
github.com/conformal/btcscript/opcode.go opcodeAdd 100.00% (8/8)
github.com/conformal/btcscript/script.go Script.Execute 100.00% (8/8)
github.com/conformal/btcscript/script.go MultiSigScript 100.00% (8/8)
github.com/conformal/btcscript/stack.go Stack.DupN 100.00% (8/8)
github.com/conformal/btcscript/stack.go Stack.SwapN 100.00% (9/9)
github.com/conformal/btcscript/opcode.go opcodeEqual 100.00% (8/8)
github.com/conformal/btcscript/stack.go Stack.DupN 100.00% (8/8)
github.com/conformal/btcscript/script.go MultiSigScript 100.00% (8/8)
github.com/conformal/btcscript/script.go Script.Execute 100.00% (8/8)
github.com/conformal/btcscript/opcode.go opcodeSub 100.00% (8/8)
github.com/conformal/btcscript/stack.go Stack.DropN 100.00% (7/7)
github.com/conformal/btcscript/opcode.go opcode0NotEqual 100.00% (7/7)
github.com/conformal/btcscript/opcode.go opcodeAdd 100.00% (8/8)
github.com/conformal/btcscript/scriptbuilder.go ScriptBuilder.AddInt64 100.00% (7/7)
github.com/conformal/btcscript/scriptbuilder.go ScriptBuilder.AddUint64 100.00% (7/7)
github.com/conformal/btcscript/opcode.go opcodePick 100.00% (7/7)
github.com/conformal/btcscript/opcode.go opcodeRoll 100.00% (7/7)
github.com/conformal/btcscript/opcode.go opcode0NotEqual 100.00% (7/7)
github.com/conformal/btcscript/stack.go Stack.DropN 100.00% (7/7)
github.com/conformal/btcscript/opcode.go opcodeNot 100.00% (7/7)
github.com/conformal/btcscript/opcode.go opcodeEndif 100.00% (6/6)
github.com/conformal/btcscript/opcode.go opcodeVerify 100.00% (6/6)
github.com/conformal/btcscript/scriptbuilder.go ScriptBuilder.AddUint64 100.00% (7/7)
github.com/conformal/btcscript/opcode.go parsedOpcode.conditional 100.00% (6/6)
github.com/conformal/btcscript/opcode.go opcodeIfDup 100.00% (6/6)
github.com/conformal/btcscript/opcode.go opcodeElse 100.00% (6/6)
github.com/conformal/btcscript/opcode.go parsedOpcode.conditional 100.00% (6/6)
github.com/conformal/btcscript/script.go Script.validPC 100.00% (5/5)
github.com/conformal/btcscript/opcode.go parsedOpcode.exec 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeToAltStack 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeFromAltStack 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeSize 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcode1Add 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcode1Sub 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeEndif 100.00% (6/6)
github.com/conformal/btcscript/opcode.go opcodeVerify 100.00% (6/6)
github.com/conformal/btcscript/opcode.go opcodeNegate 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeRoll 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodePick 100.00% (5/5)
github.com/conformal/btcscript/stack.go Stack.PickN 100.00% (5/5)
github.com/conformal/btcscript/script.go Script.validPC 100.00% (5/5)
github.com/conformal/btcscript/script.go removeOpcode 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeAbs 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeRipemd160 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeSha1 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeSha256 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeHash160 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeHash256 100.00% (5/5)
github.com/conformal/btcscript/script.go Script.DisasmScript 100.00% (5/5)
github.com/conformal/btcscript/script.go removeOpcode 100.00% (5/5)
github.com/conformal/btcscript/script.go removeOpcodeByData 100.00% (5/5)
github.com/conformal/btcscript/stack.go Stack.PickN 100.00% (5/5)
github.com/conformal/btcscript/stack.go Stack.RollN 100.00% (5/5)
github.com/conformal/btcscript/script.go isPushOnly 100.00% (4/4)
github.com/conformal/btcscript/opcode.go opcodeFromAltStack 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeHash160 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeToAltStack 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcode1Add 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcode1Sub 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeSize 100.00% (5/5)
github.com/conformal/btcscript/script.go removeOpcodeByData 100.00% (5/5)
github.com/conformal/btcscript/opcode.go opcodeEqualVerify 100.00% (4/4)
github.com/conformal/btcscript/opcode.go opcodeNumEqualVerify 100.00% (4/4)
github.com/conformal/btcscript/script.go getStack 100.00% (4/4)
github.com/conformal/btcscript/script.go GetScriptClass 100.00% (4/4)
github.com/conformal/btcscript/opcode.go opcodeCheckMultiSigVerify 100.00% (4/4)
github.com/conformal/btcscript/stack.go Stack.PeekBool 100.00% (4/4)
github.com/conformal/btcscript/stack.go asBool 100.00% (4/4)
github.com/conformal/btcscript/stack.go Stack.PeekInt 100.00% (4/4)
github.com/conformal/btcscript/stack.go Stack.PeekByteArray 100.00% (4/4)
github.com/conformal/btcscript/stack.go Stack.PopBool 100.00% (4/4)
github.com/conformal/btcscript/opcode.go opcodePushData 100.00% (4/4)
github.com/conformal/btcscript/script.go Script.curPC 100.00% (4/4)
github.com/conformal/btcscript/script.go IsPayToScriptHash 100.00% (4/4)
github.com/conformal/btcscript/stack.go Stack.PopInt 100.00% (4/4)
github.com/conformal/btcscript/script.go Script.DisasmPC 100.00% (4/4)
github.com/conformal/btcscript/script.go getStack 100.00% (4/4)
github.com/conformal/btcscript/script.go isNullData 100.00% (4/4)
github.com/conformal/btcscript/script.go scriptUInt8 100.00% (3/3)
github.com/conformal/btcscript/script.go scriptUInt16 100.00% (3/3)
github.com/conformal/btcscript/script.go ScriptClass.String 100.00% (3/3)
github.com/conformal/btcscript/script.go isSmallInt 100.00% (3/3)
github.com/conformal/btcscript/script.go scriptUInt32 100.00% (3/3)
github.com/conformal/btcscript/script.go asSmallInt 100.00% (3/3)
github.com/conformal/btcscript/opcode.go opcodeCheckMultiSigVerify 100.00% (4/4)
github.com/conformal/btcscript/script.go Script.DisasmPC 100.00% (4/4)
github.com/conformal/btcscript/opcode.go parsedOpcode.alwaysIllegal 100.00% (4/4)
github.com/conformal/btcscript/stack.go Stack.PopBool 100.00% (4/4)
github.com/conformal/btcscript/stack.go Stack.PeekBool 100.00% (4/4)
github.com/conformal/btcscript/script.go isPushOnly 100.00% (4/4)
github.com/conformal/btcscript/script.go GetScriptClass 100.00% (4/4)
github.com/conformal/btcscript/script.go IsPayToScriptHash 100.00% (4/4)
github.com/conformal/btcscript/stack.go asBool 100.00% (4/4)
github.com/conformal/btcscript/opcode.go opcodeNumEqualVerify 100.00% (4/4)
github.com/conformal/btcscript/stack.go Stack.PeekInt 100.00% (4/4)
github.com/conformal/btcscript/stack.go Stack.PopInt 100.00% (4/4)
github.com/conformal/btcscript/stack.go fromBool 100.00% (3/3)
github.com/conformal/btcscript/script.go isSmallInt 100.00% (3/3)
github.com/conformal/btcscript/script.go ScriptClass.String 100.00% (3/3)
github.com/conformal/btcscript/script.go setStack 100.00% (3/3)
github.com/conformal/btcscript/script.go GetSigOpCount 100.00% (2/2)
github.com/conformal/btcscript/opcode.go opcodeFalse 100.00% (2/2)
github.com/conformal/btcscript/script.go asSmallInt 100.00% (3/3)
github.com/conformal/btcscript/opcode.go opcodePushData 100.00% (2/2)
github.com/conformal/btcscript/opcode.go opcode1Negate 100.00% (2/2)
github.com/conformal/btcscript/opcode.go calcHash 100.00% (2/2)
github.com/conformal/btcscript/opcode.go opcodeDepth 100.00% (2/2)
github.com/conformal/btcscript/stack.go Stack.Depth 100.00% (2/2)
github.com/conformal/btcscript/scriptbuilder.go ScriptBuilder.AddOp 100.00% (2/2)
github.com/conformal/btcscript/opcode.go opcode1Negate 100.00% (2/2)
github.com/conformal/btcscript/script.go GetSigOpCount 100.00% (2/2)
github.com/conformal/btcscript/stack.go Stack.NipN 100.00% (2/2)
github.com/conformal/btcscript/opcode.go opcodeCodeSeparator 100.00% (2/2)
github.com/conformal/btcscript/opcode.go calcHash 100.00% (2/2)
github.com/conformal/btcscript/scriptbuilder.go ScriptBuilder.Reset 100.00% (2/2)
github.com/conformal/btcscript/scriptbuilder.go ScriptBuilder.AddOp 100.00% (2/2)
github.com/conformal/btcscript/opcode.go opcodeN 100.00% (2/2)
github.com/conformal/btcscript/opcode.go opcodeReserved 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeRot 100.00% (1/1)
github.com/conformal/btcscript/script.go isPubkey 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeOver 100.00% (1/1)
github.com/conformal/btcscript/script.go isScriptHash 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeNip 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeDup 100.00% (1/1)
github.com/conformal/btcscript/script.go parseScript 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeDrop 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcode2Swap 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcode2Rot 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcode2Over 100.00% (1/1)
github.com/conformal/btcscript/script.go isPubkeyHash 100.00% (1/1)
github.com/conformal/btcscript/script.go Script.disasm 100.00% (1/1)
github.com/conformal/btcscript/script.go Script.subScript 100.00% (1/1)
github.com/conformal/btcscript/log.go DisableLog 100.00% (1/1)
github.com/conformal/btcscript/log.go init 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcode3Dup 100.00% (1/1)
github.com/conformal/btcscript/script.go Script.GetStack 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeCodeSeparator 100.00% (2/2)
github.com/conformal/btcscript/opcode.go opcodeFalse 100.00% (2/2)
github.com/conformal/btcscript/script.go Script.SetStack 100.00% (1/1)
github.com/conformal/btcscript/script.go Script.GetAltStack 100.00% (1/1)
github.com/conformal/btcscript/script.go Script.SetAltStack 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcode2Dup 100.00% (1/1)
github.com/conformal/btcscript/script.go payToPubKeyHashScript 100.00% (1/1)
github.com/conformal/btcscript/script.go payToScriptHashScript 100.00% (1/1)
github.com/conformal/btcscript/script.go payToPubKeyScript 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcode2Drop 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeReturn 100.00% (1/1)
github.com/conformal/btcscript/script.go SignatureScript 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeNop 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeTuck 100.00% (1/1)
github.com/conformal/btcscript/script.go parseScript 100.00% (1/1)
github.com/conformal/btcscript/script.go isPubkey 100.00% (1/1)
github.com/conformal/btcscript/log.go DisableLog 100.00% (1/1)
github.com/conformal/btcscript/script.go isPubkeyHash 100.00% (1/1)
github.com/conformal/btcscript/opcode.go calcHash160 100.00% (1/1)
github.com/conformal/btcscript/script.go Script.disasm 100.00% (1/1)
github.com/conformal/btcscript/script.go Script.subScript 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeSwap 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeRot 100.00% (1/1)
github.com/conformal/btcscript/log.go init 100.00% (1/1)
github.com/conformal/btcscript/script.go Script.GetStack 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcode2Rot 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcode2Over 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcode3Dup 100.00% (1/1)
github.com/conformal/btcscript/scriptbuilder.go ScriptBuilder.Script 100.00% (1/1)
github.com/conformal/btcscript/scriptbuilder.go NewScriptBuilder 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeInvalid 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeDisabled 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcode2Dup 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcode2Drop 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeReturn 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeNop 100.00% (1/1)
github.com/conformal/btcscript/stack.go Stack.PushByteArray 100.00% (1/1)
github.com/conformal/btcscript/stack.go Stack.PushInt 100.00% (1/1)
github.com/conformal/btcscript/stack.go Stack.PushBool 100.00% (1/1)
github.com/conformal/btcscript/stack.go Stack.PopByteArray 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeInvalid 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeReserved 100.00% (1/1)
github.com/conformal/btcscript/opcode.go init 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeTuck 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeSwap 100.00% (1/1)
github.com/conformal/btcscript/opcode.go calcHash160 100.00% (1/1)
github.com/conformal/btcscript/log.go newLogClosure 100.00% (1/1)
github.com/conformal/btcscript/script.go isScriptHash 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeOver 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeNip 100.00% (1/1)
github.com/conformal/btcscript/script.go payToPubKeyHashScript 100.00% (1/1)
github.com/conformal/btcscript/script.go payToScriptHashScript 100.00% (1/1)
github.com/conformal/btcscript/script.go payToPubKeyScript 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeDup 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcodeDrop 100.00% (1/1)
github.com/conformal/btcscript/script.go SignatureScript 100.00% (1/1)
github.com/conformal/btcscript/opcode.go opcode2Swap 100.00% (1/1)
github.com/conformal/btcscript/script.go Script.Step 97.30% (36/37)
github.com/conformal/btcscript/script.go NewScript 95.65% (22/23)
github.com/conformal/btcscript/opcode.go opcodeCheckSig 93.10% (27/29)
github.com/conformal/btcscript/script.go unparseScript 85.71% (6/7)
github.com/conformal/btcscript/script.go expectedInputs 85.71% (6/7)
github.com/conformal/btcscript/script.go unparseScript 85.71% (6/7)
github.com/conformal/btcscript/script.go calcScriptHash 82.05% (32/39)
github.com/conformal/btcscript/script.go IsPushOnlyScript 75.00% (3/4)
github.com/conformal/btcscript/opcode.go opcodeCheckSigVerify 75.00% (3/4)
github.com/conformal/btcscript/script.go IsPushOnlyScript 75.00% (3/4)
github.com/conformal/btcscript/script.go HasCanonicalPushes 66.67% (12/18)
github.com/conformal/btcscript/log.go SetLogWriter 0.00% (0/10)
github.com/conformal/btcscript/script.go CalcMultiSigStats 0.00% (0/8)
github.com/conformal/btcscript/script.go @540:34 0.00% (0/6)
github.com/conformal/btcscript/script.go @528:34 0.00% (0/4)
github.com/conformal/btcscript/script.go @573:34 0.00% (0/3)
github.com/conformal/btcscript/log.go logClosure.String 0.00% (0/1)
github.com/conformal/btcscript/opcode.go @1741:33 0.00% (0/1)
github.com/conformal/btcscript/script.go @566:34 0.00% (0/6)
github.com/conformal/btcscript/script.go @554:34 0.00% (0/4)
github.com/conformal/btcscript/script.go @599:34 0.00% (0/3)
github.com/conformal/btcscript/opcode.go opcodeDisabled 0.00% (0/1)
github.com/conformal/btcscript/log.go UseLogger 0.00% (0/1)
github.com/conformal/btcscript --------------------------- 95.19% (1049/1102)
github.com/conformal/btcscript/opcode.go @1803:33 0.00% (0/1)
github.com/conformal/btcscript/log.go logClosure.String 0.00% (0/1)
github.com/conformal/btcscript --------------------------- 94.95% (1054/1110)