MCPcopy Create free account
hub / github.com/btcsuite/btcd / TestIsPayToScriptHash

Function TestIsPayToScriptHash

txscript/script_test.go:505–517  ·  view source on GitHub ↗

TestIsPayToScriptHash ensures the IsPayToScriptHash function returns the expected results for all the scripts in scriptClassTests.

(t *testing.T)

Source from the content-addressed store, hash-verified

503// TestIsPayToScriptHash ensures the IsPayToScriptHash function returns the
504// expected results for all the scripts in scriptClassTests.
505func 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.

Callers

nothing calls this directly

Calls 2

mustParseShortFormFunction · 0.85
IsPayToScriptHashFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…