MCPcopy Create free account
hub / github.com/copernet/copernicus / TestScript_IsStandardScriptPubKey_Error

Function TestScript_IsStandardScriptPubKey_Error

model/script/script_test.go:750–775  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

748}
749
750func TestScript_IsStandardScriptPubKey_Error(t *testing.T) {
751 pubKeysData := []string{
752 "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
753 "038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508",
754 "03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640",
755 }
756
757 var wantPubKeys [][]byte
758
759 wantPubKeyType := ScriptNonStandard
760 wantPubKeys = nil
761 wantIsStandard := false
762
763 testScript := NewEmptyScript()
764 for _, v := range pubKeysData {
765 testScript.PushSingleData(hexToBytes(v))
766 }
767 testScript.PushInt64(3)
768 testScript.PushOpCode(OP_CHECKMULTISIG)
769
770 pubKeyType, pubKeys, isStandard := testScript.IsStandardScriptPubKey()
771
772 assert.Equal(t, wantPubKeyType, pubKeyType)
773 assert.Equal(t, wantPubKeys, pubKeys)
774 assert.Equal(t, wantIsStandard, isStandard)
775}
776
777func TestScript_CheckScriptSigStandard_ScriptPubKeyHash(t *testing.T) {
778 wantPubkeyType := ScriptPubkeyHash

Callers

nothing calls this directly

Calls 7

NewEmptyScriptFunction · 0.85
hexToBytesFunction · 0.85
PushSingleDataMethod · 0.80
PushInt64Method · 0.80
PushOpCodeMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected