TestIsPushOnlyScript ensures the IsPushOnlyScript function returns the expected results.
(t *testing.T)
| 596 | // TestIsPushOnlyScript ensures the IsPushOnlyScript function returns the |
| 597 | // expected results. |
| 598 | func 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. |
nothing calls this directly
no test coverage detected
searching dependent graphs…