diff --git a/packages/isc/chainid_test.go b/packages/isc/chainid_test.go index 0a318ad3c6..fce7e74e42 100644 --- a/packages/isc/chainid_test.go +++ b/packages/isc/chainid_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/iotaledger/wasp/packages/util/rwutil" + "github.com/stretchr/testify/require" ) func TestChainIDSerialization(t *testing.T) { @@ -12,3 +13,10 @@ func TestChainIDSerialization(t *testing.T) { rwutil.BytesTest(t, chainID, ChainIDFromBytes) rwutil.StringTest(t, chainID, ChainIDFromString) } + +func TestIncorrectPrefix(t *testing.T) { + chainID := "rms1prxunz807j39nmhzy3gre4hwdlzvdjyrkfn59d27x6xh426y8ajt205mh9g" + _, err := ChainIDFromString(chainID) + + require.ErrorContains(t, err, "invalid network prefix: rms", "expected error for incorrect prefix") +}