From 5f8c5ee6fc10e7f87944891c0092b3ad0bfd5cf1 Mon Sep 17 00:00:00 2001 From: vitaliy Date: Thu, 25 Jul 2024 15:35:15 +0300 Subject: [PATCH] Add tests --- packages/isc/chainid_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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") +}