MCPcopy Index your code
hub / github.com/btcsuite/btcd / TestIsPushOnlyScript

Function TestIsPushOnlyScript

txscript/script_test.go:598–616  ·  view source on GitHub ↗

TestIsPushOnlyScript ensures the IsPushOnlyScript function returns the expected results.

(t *testing.T)

Source from the content-addressed store, hash-verified

596// TestIsPushOnlyScript ensures the IsPushOnlyScript function returns the
597// expected results.
598func TestIsPushOnlyScript(t *testing.T) {
599 t.Parallel()
600
601 test := struct {
602 name string
603 script []byte
604 expected bool
605 }{
606 name: "does not parse",
607 script: mustParseShortForm("0x046708afdb0fe5548271967f1a67130" +
608 "b7105cd6a828e03909a67962e0ea1f61d"),
609 expected: false,
610 }
611
612 if IsPushOnlyScript(test.script) != test.expected {
613 t.Errorf("IsPushOnlyScript (%s) wrong result\ngot: %v\nwant: "+
614 "%v", test.name, true, test.expected)
615 }
616}
617
618// TestIsUnspendable ensures the IsUnspendable function returns the expected
619// results.

Callers

nothing calls this directly

Calls 2

mustParseShortFormFunction · 0.85
IsPushOnlyScriptFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…