Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
vitaliy committed Jul 25, 2024
1 parent c22ab14 commit 5f8c5ee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/isc/chainid_test.go
Original file line number Diff line number Diff line change
@@ -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")
}

0 comments on commit 5f8c5ee

Please sign in to comment.