Skip to content

Commit

Permalink
chore: In TestKeyManagement, check with IsErrKeyNotFound.
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Thompson <[email protected]>
  • Loading branch information
jefft0 committed Nov 9, 2023
1 parent 17e247b commit 2e1b2e7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tm2/pkg/crypto/keys/keybase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/gnolang/gno/tm2/pkg/crypto"
"github.com/gnolang/gno/tm2/pkg/crypto/ed25519"
"github.com/gnolang/gno/tm2/pkg/crypto/keys/keyerror"
)

func TestCreateAccountInvalidMnemonic(t *testing.T) {
Expand Down Expand Up @@ -104,9 +105,9 @@ func TestKeyManagement(t *testing.T) {
require.True(t, has)
addr, err := crypto.AddressFromBech32("g1frtkxv37nq7arvyz5p0mtjqq7hwuvd4dnt892p")
require.NoError(t, err)
has, err = cstore.HasByAddress(addr)
require.NoError(t, err)
require.False(t, has)
_, err = cstore.GetByAddress(addr)
require.NotNil(t, err)
require.True(t, keyerror.IsErrKeyNotFound(err))

// list shows them in order
keyS, err := cstore.List()
Expand Down

0 comments on commit 2e1b2e7

Please sign in to comment.