TestIsPayToScriptHash ensures the IsPayToScriptHash function returns the expected results for all the scripts in scriptClassTests.
(t *testing.T)
| 503 | // TestIsPayToScriptHash ensures the IsPayToScriptHash function returns the |
| 504 | // expected results for all the scripts in scriptClassTests. |
| 505 | func TestIsPayToScriptHash(t *testing.T) { |
| 506 | t.Parallel() |
| 507 | |
| 508 | for _, test := range scriptClassTests { |
| 509 | script := mustParseShortForm(test.script) |
| 510 | shouldBe := (test.class == ScriptHashTy) |
| 511 | p2sh := IsPayToScriptHash(script) |
| 512 | if p2sh != shouldBe { |
| 513 | t.Errorf("%s: expected p2sh %v, got %v", test.name, |
| 514 | shouldBe, p2sh) |
| 515 | } |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | // TestIsPayToWitnessScriptHash ensures the IsPayToWitnessScriptHash function |
| 520 | // returns the expected results for all the scripts in scriptClassTests. |
nothing calls this directly
no test coverage detected
searching dependent graphs…