penumbra_custody/
null_kms.rsuse penumbra_proto::custody::v1::{self as pb};
use tonic::{async_trait, Request, Response, Status};
#[derive(Debug, Default)]
pub struct NullKms {}
#[async_trait]
impl pb::custody_service_server::CustodyService for NullKms {
async fn authorize(
&self,
_request: Request<pb::AuthorizeRequest>,
) -> Result<Response<pb::AuthorizeResponse>, Status> {
Err(tonic::Status::failed_precondition(
"Got authorization request in view-only mode to null KMS.",
))
}
async fn authorize_validator_definition(
&self,
_request: Request<pb::AuthorizeValidatorDefinitionRequest>,
) -> Result<Response<pb::AuthorizeValidatorDefinitionResponse>, Status> {
Err(tonic::Status::failed_precondition(
"Got authorization request in view-only mode to null KMS.",
))
}
async fn authorize_validator_vote(
&self,
_request: Request<pb::AuthorizeValidatorVoteRequest>,
) -> Result<Response<pb::AuthorizeValidatorVoteResponse>, Status> {
Err(tonic::Status::failed_precondition(
"Got authorization request in view-only mode to null KMS.",
))
}
async fn export_full_viewing_key(
&self,
_request: Request<pb::ExportFullViewingKeyRequest>,
) -> Result<Response<pb::ExportFullViewingKeyResponse>, Status> {
Err(tonic::Status::failed_precondition(
"Got authorization request in view-only mode to null KMS.",
))
}
async fn confirm_address(
&self,
_request: Request<pb::ConfirmAddressRequest>,
) -> Result<Response<pb::ConfirmAddressResponse>, Status> {
Err(tonic::Status::failed_precondition(
"Got authorization request in view-only mode to null KMS.",
))
}
}