From cdcd3d879ae2981d7db5c77ba72079fe54c3fe99 Mon Sep 17 00:00:00 2001 From: Stas Dm Date: Tue, 1 Oct 2024 16:14:01 +0200 Subject: [PATCH] fix: key id --- wrapper/localsuite/creator_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wrapper/localsuite/creator_test.go b/wrapper/localsuite/creator_test.go index 455c27f..1238db5 100644 --- a/wrapper/localsuite/creator_test.go +++ b/wrapper/localsuite/creator_test.go @@ -17,13 +17,15 @@ import ( kmsapi "github.com/trustbloc/kms-go/spi/kms" ) +const ( + keyID = "foo" +) + func TestKeyCreator(t *testing.T) { t.Run("success", func(t *testing.T) { keyBytes, _, err := ed25519.GenerateKey(rand.Reader) require.NoError(t, err) - keyID := "foo" - creator := newKeyCreator(&mockkms.KeyManager{ CrAndExportPubKeyValue: keyBytes, CrAndExportPubKeyID: keyID, @@ -45,8 +47,6 @@ func TestKeyCreator(t *testing.T) { keyBytes, _, err := ed25519.GenerateKey(rand.Reader) require.NoError(t, err) - keyID := "foo" - creator := newKeyCreator(&mockkms.KeyManager{ ExportPubKeyTypeValue: kmsapi.ED25519Type, ExportPubKeyBytesValue: keyBytes, @@ -77,7 +77,7 @@ func TestKeyCreator(t *testing.T) { t.Run("kms exports invalid key value", func(t *testing.T) { creator := newKeyCreator(&mockkms.KeyManager{ - CrAndExportPubKeyValue: []byte("foo"), + CrAndExportPubKeyValue: []byte(keyID), }) pubJWK, err := creator.Create(kmsapi.ECDSAP256DER)