package chaincfg import "testing" // TestInvalidHashStr ensures the newShaHashFromStr function panics when used to with an invalid hash string. func TestInvalidHashStr(t *testing.T) { defer func() { if r := recover(); r == nil { t.Errorf("Expected panic for invalid hash, got nil") } }() newHashFromStr("banana") } // TestMustRegisterPanic ensures the mustRegister function panics when used to register an invalid network. func TestMustRegisterPanic(t *testing.T) { t.Parallel() // Setup a defer to catch the expected panic to ensure it actually paniced. defer func() { if e := recover(); e == nil { t.Error("mustRegister did not panic as expected") } }() // Intentionally try to register duplicate netparams to force a panic. mustRegister(&MainNetParams) }