Add 100% test coverage for new ScriptBuilder code.
This commit is contained in:
parent
50173b865b
commit
5a660e95f9
2 changed files with 345 additions and 88 deletions
249
scriptbuilder_test.go
Normal file
249
scriptbuilder_test.go
Normal file
|
@ -0,0 +1,249 @@
|
|||
// Copyright (c) 2013-2014 Conformal Systems LLC.
|
||||
// Use of this source code is governed by an ISC
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package btcscript_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/conformal/btcscript"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestScriptBuilderPushOp tests that pushing opcodes to a script via the
|
||||
// ScriptBuilder API works as expected.
|
||||
func TestScriptBuilderPushOp(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
opcodes []byte
|
||||
expected []byte
|
||||
}{
|
||||
{
|
||||
name: "push OP_0",
|
||||
opcodes: []byte{btcscript.OP_0},
|
||||
expected: []byte{btcscript.OP_0},
|
||||
},
|
||||
{
|
||||
name: "push OP_1 OP_2",
|
||||
opcodes: []byte{btcscript.OP_1, btcscript.OP_2},
|
||||
expected: []byte{btcscript.OP_1, btcscript.OP_2},
|
||||
},
|
||||
{
|
||||
name: "push OP_HASH160 OP_EQUAL",
|
||||
opcodes: []byte{btcscript.OP_HASH160, btcscript.OP_EQUAL},
|
||||
expected: []byte{btcscript.OP_HASH160, btcscript.OP_EQUAL},
|
||||
},
|
||||
}
|
||||
|
||||
builder := btcscript.NewScriptBuilder()
|
||||
t.Logf("Running %d tests", len(tests))
|
||||
for i, test := range tests {
|
||||
builder.Reset()
|
||||
for _, opcode := range test.opcodes {
|
||||
builder.PushOp(opcode)
|
||||
}
|
||||
result := builder.Script()
|
||||
if !bytes.Equal(result, test.expected) {
|
||||
t.Errorf("ScriptBuilder.PushOp #%d (%s) wrong result\n"+
|
||||
"got: %x\nwant: %x", i, test.name, result,
|
||||
test.expected)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestScriptBuilderPushInt64 tests that pushing signed integers to a script via
|
||||
// the ScriptBuilder API works as expected.
|
||||
func TestScriptBuilderPushInt64(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
val int64
|
||||
expected []byte
|
||||
}{
|
||||
{name: "push -1", val: -1, expected: []byte{btcscript.OP_1NEGATE}},
|
||||
{name: "push small int 0", val: 0, expected: []byte{btcscript.OP_0}},
|
||||
{name: "push small int 1", val: 1, expected: []byte{btcscript.OP_1}},
|
||||
{name: "push small int 2", val: 2, expected: []byte{btcscript.OP_2}},
|
||||
{name: "push small int 3", val: 3, expected: []byte{btcscript.OP_3}},
|
||||
{name: "push small int 4", val: 4, expected: []byte{btcscript.OP_4}},
|
||||
{name: "push small int 5", val: 5, expected: []byte{btcscript.OP_5}},
|
||||
{name: "push small int 6", val: 6, expected: []byte{btcscript.OP_6}},
|
||||
{name: "push small int 7", val: 7, expected: []byte{btcscript.OP_7}},
|
||||
{name: "push small int 8", val: 8, expected: []byte{btcscript.OP_8}},
|
||||
{name: "push small int 9", val: 9, expected: []byte{btcscript.OP_9}},
|
||||
{name: "push small int 10", val: 10, expected: []byte{btcscript.OP_10}},
|
||||
{name: "push small int 11", val: 11, expected: []byte{btcscript.OP_11}},
|
||||
{name: "push small int 12", val: 12, expected: []byte{btcscript.OP_12}},
|
||||
{name: "push small int 13", val: 13, expected: []byte{btcscript.OP_13}},
|
||||
{name: "push small int 14", val: 14, expected: []byte{btcscript.OP_14}},
|
||||
{name: "push small int 15", val: 15, expected: []byte{btcscript.OP_15}},
|
||||
{name: "push small int 16", val: 16, expected: []byte{btcscript.OP_16}},
|
||||
{name: "push 17", val: 17, expected: []byte{btcscript.OP_DATA_1, 0x11}},
|
||||
{name: "push 65", val: 65, expected: []byte{btcscript.OP_DATA_1, 0x41}},
|
||||
{name: "push 127", val: 127, expected: []byte{btcscript.OP_DATA_1, 0x7f}},
|
||||
{name: "push 128", val: 128, expected: []byte{btcscript.OP_DATA_2, 0x80, 0}},
|
||||
{name: "push 255", val: 255, expected: []byte{btcscript.OP_DATA_2, 0xff, 0}},
|
||||
{name: "push 256", val: 256, expected: []byte{btcscript.OP_DATA_2, 0, 0x01}},
|
||||
{name: "push 32767", val: 32767, expected: []byte{btcscript.OP_DATA_2, 0xff, 0x7f}},
|
||||
{name: "push 32768", val: 32768, expected: []byte{btcscript.OP_DATA_3, 0, 0x80, 0}},
|
||||
{name: "push -2", val: -2, expected: []byte{btcscript.OP_DATA_1, 0x82}},
|
||||
{name: "push -3", val: -3, expected: []byte{btcscript.OP_DATA_1, 0x83}},
|
||||
{name: "push -4", val: -4, expected: []byte{btcscript.OP_DATA_1, 0x84}},
|
||||
{name: "push -5", val: -5, expected: []byte{btcscript.OP_DATA_1, 0x85}},
|
||||
{name: "push -17", val: -17, expected: []byte{btcscript.OP_DATA_1, 0x91}},
|
||||
{name: "push -65", val: -65, expected: []byte{btcscript.OP_DATA_1, 0xc1}},
|
||||
{name: "push -127", val: -127, expected: []byte{btcscript.OP_DATA_1, 0xff}},
|
||||
{name: "push -128", val: -128, expected: []byte{btcscript.OP_DATA_2, 0x80, 0x80}},
|
||||
{name: "push -255", val: -255, expected: []byte{btcscript.OP_DATA_2, 0xff, 0x80}},
|
||||
{name: "push -256", val: -256, expected: []byte{btcscript.OP_DATA_2, 0x00, 0x81}},
|
||||
{name: "push -32767", val: -32767, expected: []byte{btcscript.OP_DATA_2, 0xff, 0xff}},
|
||||
{name: "push -32768", val: -32768, expected: []byte{btcscript.OP_DATA_3, 0x00, 0x80, 0x80}},
|
||||
}
|
||||
|
||||
builder := btcscript.NewScriptBuilder()
|
||||
t.Logf("Running %d tests", len(tests))
|
||||
for i, test := range tests {
|
||||
builder.Reset().PushInt64(test.val)
|
||||
result := builder.Script()
|
||||
if !bytes.Equal(result, test.expected) {
|
||||
t.Errorf("ScriptBuilder.PushInt64 #%d (%s) wrong result\n"+
|
||||
"got: %x\nwant: %x", i, test.name, result,
|
||||
test.expected)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestScriptBuilderPushUint64 tests that pushing unsigned integers to a script
|
||||
// via the ScriptBuilder API works as expected.
|
||||
func TestScriptBuilderPushUint64(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
val uint64
|
||||
expected []byte
|
||||
}{
|
||||
{name: "push small int 0", val: 0, expected: []byte{btcscript.OP_0}},
|
||||
{name: "push small int 1", val: 1, expected: []byte{btcscript.OP_1}},
|
||||
{name: "push small int 2", val: 2, expected: []byte{btcscript.OP_2}},
|
||||
{name: "push small int 3", val: 3, expected: []byte{btcscript.OP_3}},
|
||||
{name: "push small int 4", val: 4, expected: []byte{btcscript.OP_4}},
|
||||
{name: "push small int 5", val: 5, expected: []byte{btcscript.OP_5}},
|
||||
{name: "push small int 6", val: 6, expected: []byte{btcscript.OP_6}},
|
||||
{name: "push small int 7", val: 7, expected: []byte{btcscript.OP_7}},
|
||||
{name: "push small int 8", val: 8, expected: []byte{btcscript.OP_8}},
|
||||
{name: "push small int 9", val: 9, expected: []byte{btcscript.OP_9}},
|
||||
{name: "push small int 10", val: 10, expected: []byte{btcscript.OP_10}},
|
||||
{name: "push small int 11", val: 11, expected: []byte{btcscript.OP_11}},
|
||||
{name: "push small int 12", val: 12, expected: []byte{btcscript.OP_12}},
|
||||
{name: "push small int 13", val: 13, expected: []byte{btcscript.OP_13}},
|
||||
{name: "push small int 14", val: 14, expected: []byte{btcscript.OP_14}},
|
||||
{name: "push small int 15", val: 15, expected: []byte{btcscript.OP_15}},
|
||||
{name: "push small int 16", val: 16, expected: []byte{btcscript.OP_16}},
|
||||
{name: "push 17", val: 17, expected: []byte{btcscript.OP_DATA_1, 0x11}},
|
||||
{name: "push 65", val: 65, expected: []byte{btcscript.OP_DATA_1, 0x41}},
|
||||
{name: "push 127", val: 127, expected: []byte{btcscript.OP_DATA_1, 0x7f}},
|
||||
{name: "push 128", val: 128, expected: []byte{btcscript.OP_DATA_2, 0x80, 0}},
|
||||
{name: "push 255", val: 255, expected: []byte{btcscript.OP_DATA_2, 0xff, 0}},
|
||||
{name: "push 256", val: 256, expected: []byte{btcscript.OP_DATA_2, 0, 0x01}},
|
||||
{name: "push 32767", val: 32767, expected: []byte{btcscript.OP_DATA_2, 0xff, 0x7f}},
|
||||
{name: "push 32768", val: 32768, expected: []byte{btcscript.OP_DATA_3, 0, 0x80, 0}},
|
||||
}
|
||||
|
||||
builder := btcscript.NewScriptBuilder()
|
||||
t.Logf("Running %d tests", len(tests))
|
||||
for i, test := range tests {
|
||||
builder.Reset().PushUint64(test.val)
|
||||
result := builder.Script()
|
||||
if !bytes.Equal(result, test.expected) {
|
||||
t.Errorf("ScriptBuilder.PushUint64 #%d (%s) wrong result\n"+
|
||||
"got: %x\nwant: %x", i, test.name, result,
|
||||
test.expected)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestScriptBuilderPushData tests that pushing data to a script via the
|
||||
// ScriptBuilder API works as expected.
|
||||
func TestScriptBuilderPushData(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
data []byte
|
||||
expected []byte
|
||||
}{
|
||||
// Start off with the small ints to ensure canonical encoding.
|
||||
{name: "push small int 0", data: []byte{0}, expected: []byte{btcscript.OP_0}},
|
||||
{name: "push small int 1", data: []byte{1}, expected: []byte{btcscript.OP_1}},
|
||||
{name: "push small int 2", data: []byte{2}, expected: []byte{btcscript.OP_2}},
|
||||
{name: "push small int 3", data: []byte{3}, expected: []byte{btcscript.OP_3}},
|
||||
{name: "push small int 4", data: []byte{4}, expected: []byte{btcscript.OP_4}},
|
||||
{name: "push small int 5", data: []byte{5}, expected: []byte{btcscript.OP_5}},
|
||||
{name: "push small int 6", data: []byte{6}, expected: []byte{btcscript.OP_6}},
|
||||
{name: "push small int 7", data: []byte{7}, expected: []byte{btcscript.OP_7}},
|
||||
{name: "push small int 8", data: []byte{8}, expected: []byte{btcscript.OP_8}},
|
||||
{name: "push small int 9", data: []byte{9}, expected: []byte{btcscript.OP_9}},
|
||||
{name: "push small int 10", data: []byte{10}, expected: []byte{btcscript.OP_10}},
|
||||
{name: "push small int 11", data: []byte{11}, expected: []byte{btcscript.OP_11}},
|
||||
{name: "push small int 12", data: []byte{12}, expected: []byte{btcscript.OP_12}},
|
||||
{name: "push small int 13", data: []byte{13}, expected: []byte{btcscript.OP_13}},
|
||||
{name: "push small int 14", data: []byte{14}, expected: []byte{btcscript.OP_14}},
|
||||
{name: "push small int 15", data: []byte{15}, expected: []byte{btcscript.OP_15}},
|
||||
{name: "push small int 16", data: []byte{16}, expected: []byte{btcscript.OP_16}},
|
||||
|
||||
// 1-byte data push opcodes.
|
||||
{
|
||||
name: "push data len 17",
|
||||
data: bytes.Repeat([]byte{0x49}, 17),
|
||||
expected: append([]byte{btcscript.OP_DATA_17}, bytes.Repeat([]byte{0x49}, 17)...),
|
||||
},
|
||||
{
|
||||
name: "push data len 75",
|
||||
data: bytes.Repeat([]byte{0x49}, 75),
|
||||
expected: append([]byte{btcscript.OP_DATA_75}, bytes.Repeat([]byte{0x49}, 75)...),
|
||||
},
|
||||
|
||||
// 2-byte data push via OP_PUSHDATA_1.
|
||||
{
|
||||
name: "push data len 76",
|
||||
data: bytes.Repeat([]byte{0x49}, 76),
|
||||
expected: append([]byte{btcscript.OP_PUSHDATA1, 76}, bytes.Repeat([]byte{0x49}, 76)...),
|
||||
},
|
||||
{
|
||||
name: "push data len 255",
|
||||
data: bytes.Repeat([]byte{0x49}, 255),
|
||||
expected: append([]byte{btcscript.OP_PUSHDATA1, 255}, bytes.Repeat([]byte{0x49}, 255)...),
|
||||
},
|
||||
|
||||
// 3-byte data push via OP_PUSHDATA_2.
|
||||
{
|
||||
name: "push data len 256",
|
||||
data: bytes.Repeat([]byte{0x49}, 256),
|
||||
expected: append([]byte{btcscript.OP_PUSHDATA2, 0, 1}, bytes.Repeat([]byte{0x49}, 256)...),
|
||||
},
|
||||
{
|
||||
name: "push data len 32767",
|
||||
data: bytes.Repeat([]byte{0x49}, 32767),
|
||||
expected: append([]byte{btcscript.OP_PUSHDATA2, 255, 127}, bytes.Repeat([]byte{0x49}, 32767)...),
|
||||
},
|
||||
|
||||
// 5-byte data push via OP_PUSHDATA_4.
|
||||
{
|
||||
name: "push data len 65536",
|
||||
data: bytes.Repeat([]byte{0x49}, 65536),
|
||||
expected: append([]byte{btcscript.OP_PUSHDATA4, 0, 0, 1, 0}, bytes.Repeat([]byte{0x49}, 65536)...),
|
||||
},
|
||||
}
|
||||
|
||||
builder := btcscript.NewScriptBuilder()
|
||||
t.Logf("Running %d tests", len(tests))
|
||||
for i, test := range tests {
|
||||
builder.Reset().PushData(test.data)
|
||||
result := builder.Script()
|
||||
if !bytes.Equal(result, test.expected) {
|
||||
t.Errorf("ScriptBuilder.PushData #%d (%s) wrong result\n"+
|
||||
"got: %x\nwant: %x", i, test.name, result,
|
||||
test.expected)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,152 +6,160 @@ 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/opcode.go parsedOpcode.bytes 100.00% (23/23)
|
||||
github.com/conformal/btcscript/script.go NewScript 100.00% (21/21)
|
||||
github.com/conformal/btcscript/scriptbuilder.go ScriptBuilder.PushData 100.00% (21/21)
|
||||
github.com/conformal/btcscript/stack.go asInt 100.00% (21/21)
|
||||
github.com/conformal/btcscript/script.go signatureScriptCustomReader 100.00% (16/16)
|
||||
github.com/conformal/btcscript/opcode.go parsedOpcode.print 100.00% (16/16)
|
||||
github.com/conformal/btcscript/script.go signatureScriptCustomReader 100.00% (16/16)
|
||||
github.com/conformal/btcscript/stack.go Stack.nipN 100.00% (14/14)
|
||||
github.com/conformal/btcscript/stack.go fromInt 100.00% (14/14)
|
||||
github.com/conformal/btcscript/opcode.go opcodeWithin 100.00% (13/13)
|
||||
github.com/conformal/btcscript/script.go GetPreciseSigOpCount 100.00% (13/13)
|
||||
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 opcodeIf 100.00% (11/11)
|
||||
github.com/conformal/btcscript/opcode.go opcodeNotIf 100.00% (11/11)
|
||||
github.com/conformal/btcscript/opcode.go opcodeNumEqual 100.00% (10/10)
|
||||
github.com/conformal/btcscript/stack.go Stack.Tuck 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 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/opcode.go opcodeMin 100.00% (10/10)
|
||||
github.com/conformal/btcscript/opcode.go opcodeMax 100.00% (10/10)
|
||||
github.com/conformal/btcscript/opcode.go opcodeMin 100.00% (10/10)
|
||||
github.com/conformal/btcscript/opcode.go opcodeGreaterThan 100.00% (10/10)
|
||||
github.com/conformal/btcscript/script.go getSigOpCount 100.00% (10/10)
|
||||
github.com/conformal/btcscript/stack.go Stack.OverN 100.00% (9/9)
|
||||
github.com/conformal/btcscript/stack.go Stack.RotN 100.00% (9/9)
|
||||
github.com/conformal/btcscript/opcode.go opcodeNumEqual 100.00% (10/10)
|
||||
github.com/conformal/btcscript/opcode.go opcodeBoolOr 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 opcodeGreaterThanOrEqual 100.00% (10/10)
|
||||
github.com/conformal/btcscript/opcode.go opcodeLessThanOrEqual 100.00% (10/10)
|
||||
github.com/conformal/btcscript/opcode.go opcodeLessThan 100.00% (10/10)
|
||||
github.com/conformal/btcscript/opcode.go opcodeNumNotEqual 100.00% (10/10)
|
||||
github.com/conformal/btcscript/script.go DisasmString 100.00% (9/9)
|
||||
github.com/conformal/btcscript/stack.go Stack.RotN 100.00% (9/9)
|
||||
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/script.go PayToAddrScript 100.00% (8/8)
|
||||
github.com/conformal/btcscript/opcode.go opcodeAdd 100.00% (8/8)
|
||||
github.com/conformal/btcscript/opcode.go opcodeSub 100.00% (8/8)
|
||||
github.com/conformal/btcscript/stack.go Stack.DupN 100.00% (8/8)
|
||||
github.com/conformal/btcscript/script.go PayToAddrScript 100.00% (8/8)
|
||||
github.com/conformal/btcscript/opcode.go opcodeEqual 100.00% (8/8)
|
||||
github.com/conformal/btcscript/stack.go Stack.DropN 100.00% (7/7)
|
||||
github.com/conformal/btcscript/opcode.go opcodeAdd 100.00% (8/8)
|
||||
github.com/conformal/btcscript/stack.go Stack.DupN 100.00% (8/8)
|
||||
github.com/conformal/btcscript/scriptbuilder.go ScriptBuilder.PushInt64 100.00% (7/7)
|
||||
github.com/conformal/btcscript/opcode.go opcodeRoll 100.00% (7/7)
|
||||
github.com/conformal/btcscript/script.go unparseScript 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/script.go typeOfScript 100.00% (7/7)
|
||||
github.com/conformal/btcscript/opcode.go opcodeNot 100.00% (7/7)
|
||||
github.com/conformal/btcscript/scriptbuilder.go ScriptBuilder.PushUint64 100.00% (7/7)
|
||||
github.com/conformal/btcscript/opcode.go opcode0NotEqual 100.00% (7/7)
|
||||
github.com/conformal/btcscript/opcode.go opcodePick 100.00% (7/7)
|
||||
github.com/conformal/btcscript/opcode.go opcodeVerify 100.00% (6/6)
|
||||
github.com/conformal/btcscript/opcode.go opcodeEndif 100.00% (6/6)
|
||||
github.com/conformal/btcscript/opcode.go opcodeNot 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 opcodeVerify 100.00% (6/6)
|
||||
github.com/conformal/btcscript/opcode.go opcodeElse 100.00% (6/6)
|
||||
github.com/conformal/btcscript/opcode.go opcodeSize 100.00% (5/5)
|
||||
github.com/conformal/btcscript/opcode.go opcodeIfDup 100.00% (6/6)
|
||||
github.com/conformal/btcscript/opcode.go opcodeEndif 100.00% (6/6)
|
||||
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 Script.validPC 100.00% (5/5)
|
||||
github.com/conformal/btcscript/opcode.go parsedOpcode.exec 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/script.go removeOpcodeByData 100.00% (5/5)
|
||||
github.com/conformal/btcscript/script.go Script.validPC 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 opcodeNegate 100.00% (5/5)
|
||||
github.com/conformal/btcscript/opcode.go opcodeAbs 100.00% (5/5)
|
||||
github.com/conformal/btcscript/script.go removeOpcode 100.00% (5/5)
|
||||
github.com/conformal/btcscript/stack.go Stack.RollN 100.00% (5/5)
|
||||
github.com/conformal/btcscript/opcode.go opcodeSha1 100.00% (5/5)
|
||||
github.com/conformal/btcscript/opcode.go opcodeRipemd160 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/stack.go Stack.PickN 100.00% (5/5)
|
||||
github.com/conformal/btcscript/script.go removeOpcodeByData 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/script.go IsPayToScriptHash 100.00% (4/4)
|
||||
github.com/conformal/btcscript/stack.go Stack.PopBool 100.00% (4/4)
|
||||
github.com/conformal/btcscript/opcode.go opcodeNumEqualVerify 100.00% (4/4)
|
||||
github.com/conformal/btcscript/stack.go asBool 100.00% (4/4)
|
||||
github.com/conformal/btcscript/opcode.go opcodeToAltStack 100.00% (5/5)
|
||||
github.com/conformal/btcscript/stack.go Stack.RollN 100.00% (5/5)
|
||||
github.com/conformal/btcscript/script.go removeOpcode 100.00% (5/5)
|
||||
github.com/conformal/btcscript/stack.go Stack.PickN 100.00% (5/5)
|
||||
github.com/conformal/btcscript/opcode.go opcodeEqualVerify 100.00% (4/4)
|
||||
github.com/conformal/btcscript/stack.go Stack.PeekByteArray 100.00% (4/4)
|
||||
github.com/conformal/btcscript/script.go Script.DisasmPC 100.00% (4/4)
|
||||
github.com/conformal/btcscript/opcode.go opcodePushData 100.00% (4/4)
|
||||
github.com/conformal/btcscript/script.go GetScriptClass 100.00% (4/4)
|
||||
github.com/conformal/btcscript/stack.go Stack.PeekInt 100.00% (4/4)
|
||||
github.com/conformal/btcscript/script.go getStack 100.00% (4/4)
|
||||
github.com/conformal/btcscript/stack.go Stack.PeekBool 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 Script.DisasmPC 100.00% (4/4)
|
||||
github.com/conformal/btcscript/script.go Script.curPC 100.00% (4/4)
|
||||
github.com/conformal/btcscript/stack.go Stack.PopInt 100.00% (4/4)
|
||||
github.com/conformal/btcscript/opcode.go opcodeCheckMultiSigVerify 100.00% (4/4)
|
||||
github.com/conformal/btcscript/stack.go asBool 100.00% (4/4)
|
||||
github.com/conformal/btcscript/stack.go Stack.PeekByteArray 100.00% (4/4)
|
||||
github.com/conformal/btcscript/script.go GetScriptClass 100.00% (4/4)
|
||||
github.com/conformal/btcscript/script.go isPushOnly 100.00% (4/4)
|
||||
github.com/conformal/btcscript/script.go isNullData 100.00% (4/4)
|
||||
github.com/conformal/btcscript/script.go scriptUInt16 100.00% (3/3)
|
||||
github.com/conformal/btcscript/script.go scriptUInt32 100.00% (3/3)
|
||||
github.com/conformal/btcscript/script.go IsPayToScriptHash 100.00% (4/4)
|
||||
github.com/conformal/btcscript/stack.go Stack.PopBool 100.00% (4/4)
|
||||
github.com/conformal/btcscript/stack.go Stack.PopInt 100.00% (4/4)
|
||||
github.com/conformal/btcscript/opcode.go opcodePushData 100.00% (4/4)
|
||||
github.com/conformal/btcscript/stack.go Stack.PeekInt 100.00% (4/4)
|
||||
github.com/conformal/btcscript/script.go isSmallInt 100.00% (3/3)
|
||||
github.com/conformal/btcscript/stack.go fromBool 100.00% (3/3)
|
||||
github.com/conformal/btcscript/script.go ScriptClass.String 100.00% (3/3)
|
||||
github.com/conformal/btcscript/script.go asSmallInt 100.00% (3/3)
|
||||
github.com/conformal/btcscript/script.go scriptUInt32 100.00% (3/3)
|
||||
github.com/conformal/btcscript/script.go setStack 100.00% (3/3)
|
||||
github.com/conformal/btcscript/script.go scriptUInt8 100.00% (3/3)
|
||||
github.com/conformal/btcscript/script.go isSmallInt 100.00% (3/3)
|
||||
github.com/conformal/btcscript/script.go asSmallInt 100.00% (3/3)
|
||||
github.com/conformal/btcscript/stack.go Stack.NipN 100.00% (2/2)
|
||||
github.com/conformal/btcscript/opcode.go opcodeFalse 100.00% (2/2)
|
||||
github.com/conformal/btcscript/script.go scriptUInt16 100.00% (3/3)
|
||||
github.com/conformal/btcscript/opcode.go opcode1Negate 100.00% (2/2)
|
||||
github.com/conformal/btcscript/opcode.go opcodeN 100.00% (2/2)
|
||||
github.com/conformal/btcscript/scriptbuilder.go ScriptBuilder.PushOp 100.00% (2/2)
|
||||
github.com/conformal/btcscript/opcode.go opcodeDepth 100.00% (2/2)
|
||||
github.com/conformal/btcscript/opcode.go calcHash 100.00% (2/2)
|
||||
github.com/conformal/btcscript/opcode.go opcodeFalse 100.00% (2/2)
|
||||
github.com/conformal/btcscript/opcode.go opcodeCodeSeparator 100.00% (2/2)
|
||||
github.com/conformal/btcscript/stack.go Stack.Depth 100.00% (2/2)
|
||||
github.com/conformal/btcscript/script.go GetSigOpCount 100.00% (2/2)
|
||||
github.com/conformal/btcscript/script.go PayToPubKeyHashScript 100.00% (2/2)
|
||||
github.com/conformal/btcscript/script.go PayToScriptHashScript 100.00% (2/2)
|
||||
github.com/conformal/btcscript/log.go init 100.00% (1/1)
|
||||
github.com/conformal/btcscript/stack.go Stack.PopByteArray 100.00% (1/1)
|
||||
github.com/conformal/btcscript/scriptbuilder.go ScriptBuilder.Reset 100.00% (2/2)
|
||||
github.com/conformal/btcscript/stack.go Stack.NipN 100.00% (2/2)
|
||||
github.com/conformal/btcscript/script.go GetSigOpCount 100.00% (2/2)
|
||||
github.com/conformal/btcscript/opcode.go opcodeN 100.00% (2/2)
|
||||
github.com/conformal/btcscript/opcode.go calcHash 100.00% (2/2)
|
||||
github.com/conformal/btcscript/stack.go Stack.Depth 100.00% (2/2)
|
||||
github.com/conformal/btcscript/script.go PayToPubKeyHashScript 100.00% (2/2)
|
||||
github.com/conformal/btcscript/stack.go Stack.PushInt 100.00% (1/1)
|
||||
github.com/conformal/btcscript/stack.go Stack.PushByteArray 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go init 100.00% (1/1)
|
||||
github.com/conformal/btcscript/script.go Script.GetStack 100.00% (1/1)
|
||||
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/log.go newLogClosure 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeNop 100.00% (1/1)
|
||||
github.com/conformal/btcscript/script.go SignatureScript 100.00% (1/1)
|
||||
github.com/conformal/btcscript/log.go init 100.00% (1/1)
|
||||
github.com/conformal/btcscript/log.go DisableLog 100.00% (1/1)
|
||||
github.com/conformal/btcscript/log.go newLogClosure 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go init 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeDisabled 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeReserved 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeInvalid 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeNop 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeReturn 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcode2Drop 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcode2Dup 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcode3Dup 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcode2Over 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcode2Rot 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcode2Swap 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeDrop 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeDup 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeNip 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeOver 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeRot 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeSwap 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeTuck 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go calcHash160 100.00% (1/1)
|
||||
github.com/conformal/btcscript/stack.go Stack.PushByteArray 100.00% (1/1)
|
||||
github.com/conformal/btcscript/stack.go Stack.PopByteArray 100.00% (1/1)
|
||||
github.com/conformal/btcscript/stack.go Stack.PushBool 100.00% (1/1)
|
||||
github.com/conformal/btcscript/script.go Script.subScript 100.00% (1/1)
|
||||
github.com/conformal/btcscript/script.go isPubkey 100.00% (1/1)
|
||||
github.com/conformal/btcscript/script.go isPubkeyHash 100.00% (1/1)
|
||||
github.com/conformal/btcscript/script.go isScriptHash 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go calcHash160 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 opcodeRot 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 parseScript 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/opcode.go opcode2Dup 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/opcode.go opcode3Dup 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeDisabled 100.00% (1/1)
|
||||
github.com/conformal/btcscript/script.go Script.disasm 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 opcodeInvalid 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeReserved 100.00% (1/1)
|
||||
github.com/conformal/btcscript/script.go Script.GetStack 100.00% (1/1)
|
||||
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 SignatureScript 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/script.go Script.SetAltStack 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeCheckSig 90.00% (27/30)
|
||||
github.com/conformal/btcscript/script.go expectedInputs 85.71% (6/7)
|
||||
github.com/conformal/btcscript/script.go calcScriptHash 82.05% (32/39)
|
||||
github.com/conformal/btcscript/script.go Script.CheckErrorCondition 78.57% (11/14)
|
||||
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 HasCanonicalPushes 66.67% (12/18)
|
||||
github.com/conformal/btcscript/script.go Script.Execute 44.44% (8/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 IsPushOnlyScript 0.00% (0/4)
|
||||
github.com/conformal/btcscript/log.go UseLogger 0.00% (0/1)
|
||||
github.com/conformal/btcscript/log.go logClosure.String 0.00% (0/1)
|
||||
github.com/conformal/btcscript --------------------------- 95.22% (976/1025)
|
||||
github.com/conformal/btcscript --------------------------- 95.20% (1032/1084)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue