diff --git a/validator/keymanager/types.go b/validator/keymanager/types.go index b632b2b54..f77870824 100644 --- a/validator/keymanager/types.go +++ b/validator/keymanager/types.go @@ -74,13 +74,13 @@ type KeyStatus struct { type KeyStatusType string const ( - StatusImported KeyStatusType = "IMPORTED" - StatusError KeyStatusType = "ERROR" - StatusDuplicate KeyStatusType = "DUPLICATE" - StatusUnknown KeyStatusType = "UNKNOWN" - StatusNotFound KeyStatusType = "NOT_FOUND" - StatusDeleted KeyStatusType = "DELETED" - StatusNotActive KeyStatusType = "NOT_ACTIVE" + StatusImported KeyStatusType = "imported" + StatusError KeyStatusType = "error" + StatusDuplicate KeyStatusType = "duplicate" + StatusUnknown KeyStatusType = "unknown" + StatusNotFound KeyStatusType = "not_found" + StatusDeleted KeyStatusType = "deleted" + StatusNotActive KeyStatusType = "not_active" ) // PublicKeyDeleter allows deleting public keys set in keymanager. diff --git a/validator/rpc/BUILD.bazel b/validator/rpc/BUILD.bazel index 3b9915b7c..1c7742f68 100644 --- a/validator/rpc/BUILD.bazel +++ b/validator/rpc/BUILD.bazel @@ -30,6 +30,7 @@ go_library( "//async/event:go_default_library", "//beacon-chain/rpc/eth/shared:go_default_library", "//cmd:go_default_library", + "//cmd/validator/flags:go_default_library", "//config/features:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", diff --git a/validator/rpc/handlers_keymanager.go b/validator/rpc/handlers_keymanager.go index be29fdfbc..72563e3a0 100644 --- a/validator/rpc/handlers_keymanager.go +++ b/validator/rpc/handlers_keymanager.go @@ -13,6 +13,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" + "github.com/prysmaticlabs/prysm/v5/cmd/validator/flags" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/config/proposer" @@ -479,7 +480,7 @@ func (s *Server) ImportRemoteKeys(w http.ResponseWriter, r *http.Request) { } } if isUrlUsed { - log.Warnf("Setting web3signer base url for IMPORTED keys is not supported. Prysm only uses the url from --validators-external-signer-url flag for web3signerKeymanagerKind.") + log.Warnf("Setting the remote signer base url within the request is not supported. The remote signer url can only be set from the --%s flag.", flags.Web3SignerURLFlag.Name) } httputil.WriteJson(w, &RemoteKeysResponse{Data: adder.AddPublicKeys(remoteKeys)}) diff --git a/validator/rpc/handlers_keymanager_test.go b/validator/rpc/handlers_keymanager_test.go index c2b67c314..f4d923a4d 100644 --- a/validator/rpc/handlers_keymanager_test.go +++ b/validator/rpc/handlers_keymanager_test.go @@ -7,6 +7,7 @@ import ( "fmt" "net/http" "net/http/httptest" + "strings" "testing" "time" @@ -204,7 +205,7 @@ func TestServer_ImportKeystores(t *testing.T) { resp := &ImportKeystoresResponse{} require.NoError(t, json.Unmarshal(wr.Body.Bytes(), resp)) require.Equal(t, 2, len(resp.Data)) - require.Equal(t, keymanager.StatusError, resp.Data[0].Status) + require.Equal(t, fmt.Sprintf("%v", keymanager.StatusError), strings.ToLower(string(resp.Data[0].Status))) // make sure it's lower case }) t.Run("200 response even if number of passwords does not match number of keystores", func(t *testing.T) { request := &ImportKeystoresRequest{ @@ -1406,6 +1407,7 @@ func TestServer_ImportRemoteKeys(t *testing.T) { require.NoError(t, json.Unmarshal(w.Body.Bytes(), resp)) for i := 0; i < len(resp.Data); i++ { require.DeepEqual(t, expectedStatuses[i], resp.Data[i]) + require.Equal(t, fmt.Sprintf("%v", expectedStatuses[i].Status), strings.ToLower(string(resp.Data[i].Status))) } }) }