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

Function hasTaprootScriptTest

txscript/reference_test.go:390–400  ·  view source on GitHub ↗

hasTaprootScriptTest returns whether the reference script test is one of the newer taproot cases embedded in script_tests.json. Those vectors rely on Bitcoin Core-specific placeholder macros, while btcd covers taproot via the dedicated data/taproot-ref harness in TestTaprootReferenceTests.

(test []interface{})

Source from the content-addressed store, hash-verified

388// Bitcoin Core-specific placeholder macros, while btcd covers taproot via the
389// dedicated data/taproot-ref harness in TestTaprootReferenceTests.
390func hasTaprootScriptTest(test []interface{}) bool {
391 // Account for any optional leading witness data.
392 witnessOffset := scriptTestWitnessOffset(test)
393
394 if len(test) < witnessOffset+scriptTestFlagsOffset+1 {
395 return false
396 }
397
398 flags, ok := test[witnessOffset+scriptTestFlagsOffset].(string)
399 return ok && strings.Contains(flags, "TAPROOT")
400}
401
402// parseExpectedResult parses the provided expected result string into allowed
403// script error codes. An error is returned if the expected result string is

Callers 1

testScriptsFunction · 0.85

Calls 2

scriptTestWitnessOffsetFunction · 0.85
ContainsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…