From c64e17bb81502afa6820ff5a2d3a479a45e67ab3 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Wed, 24 Aug 2022 23:35:00 +0000 Subject: [PATCH] Return `readonly: false` for local keystores (#3490) ## Issue Addressed NA ## Proposed Changes Indicate that local keystores are `readonly: Some(false)` rather than `None` via the `/eth/v1/keystores` method on the VC API. I'll mark this as backwards-incompat so we remember to mention it in the release notes. There aren't any type-level incompatibilities here, just a change in how Lighthouse responds to responses. ## Additional Info - Blocked on #3464 --- validator_client/src/http_api/keystores.rs | 2 +- validator_client/src/http_api/tests/keystores.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/validator_client/src/http_api/keystores.rs b/validator_client/src/http_api/keystores.rs index 29af8d020..b886f6043 100644 --- a/validator_client/src/http_api/keystores.rs +++ b/validator_client/src/http_api/keystores.rs @@ -40,7 +40,7 @@ pub fn list( SigningMethod::LocalKeystore { ref voting_keystore, .. - } => (voting_keystore.path(), None), + } => (voting_keystore.path(), Some(false)), SigningMethod::Web3Signer { .. } => (None, Some(true)), }); diff --git a/validator_client/src/http_api/tests/keystores.rs b/validator_client/src/http_api/tests/keystores.rs index 5cc755db5..769d8a1d4 100644 --- a/validator_client/src/http_api/tests/keystores.rs +++ b/validator_client/src/http_api/tests/keystores.rs @@ -399,7 +399,7 @@ fn get_web3_signer_keystores() { .map(|local_keystore| SingleKeystoreResponse { validating_pubkey: keystore_pubkey(local_keystore), derivation_path: local_keystore.path(), - readonly: None, + readonly: Some(false), }) .chain(remote_vals.iter().map(|remote_val| SingleKeystoreResponse { validating_pubkey: remote_val.voting_public_key.compress(), @@ -1775,7 +1775,7 @@ fn import_same_local_and_remote_keys() { .map(|local_keystore| SingleKeystoreResponse { validating_pubkey: keystore_pubkey(local_keystore), derivation_path: local_keystore.path(), - readonly: None, + readonly: Some(false), }) .collect::>(); for response in expected_responses {