Skip to content

Commit

Permalink
chore: added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Jul 21, 2023
1 parent 478c5d7 commit a8e7946
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pkg/utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,29 @@ func TestSplitStringIntoChunksMoreChunks(t *testing.T) {
chunks := SplitStringIntoChunks(str, 10)
assert.Len(t, chunks, 3, "There should be 3 chunks!")
}

func TestConvertBech32PrefixInvalid(t *testing.T) {
t.Parallel()

_, err := ConvertBech32Prefix(
"test",
"cosmosvaloper",
)
assert.NotNil(t, err, "Error should be present!")
}

func TestConvertBech32PrefixValid(t *testing.T) {
t.Parallel()

address, err := ConvertBech32Prefix(
"cosmos1xqz9pemz5e5zycaa89kys5aw6m8rhgsvtp9lt2",
"cosmosvaloper",
)
assert.Nil(t, err, "Error should not be present!")
assert.Equal(
t,
address,
"cosmosvaloper1xqz9pemz5e5zycaa89kys5aw6m8rhgsvw4328e",
"Bech addresses should not be equal!",
)
}

0 comments on commit a8e7946

Please sign in to comment.