MCPcopy Create free account
hub / github.com/SeismicSystems/summit / get_validator_account

Method get_validator_account

rpc/src/server.rs:186–214  ·  view source on GitHub ↗
(
        &self,
        public_key: String,
    )

Source from the content-addressed store, hash-verified

184 finalized_header: header.as_ssz_bytes(),
185 })
186 }
187
188 async fn get_latest_checkpoint(&self) -> RpcResult<CheckpointRes> {
189 let maybe_checkpoint = self.state_query.clone().get_latest_checkpoint().await;
190
191 let (Some((checkpoint, last_block)), epoch) = maybe_checkpoint else {
192 return Err(RpcError::CheckpointNotFound.into());
193 };
194
195 // try to get the finalized header for this epoch
196 let maybe_header = self.state_query.clone().get_finalized_header(epoch).await;
197
198 let Some(header) = maybe_header else {
199 return Err(RpcError::CheckpointNotFound.into());
200 };
201
202 Ok(CheckpointRes {
203 digest: checkpoint.digest.0,
204 epoch,
205 checkpoint: checkpoint.as_ssz_bytes(),
206 last_block: last_block.as_ssz_bytes(),
207 finalized_header: header.as_ssz_bytes(),
208 })
209 }
210
211 async fn get_latest_checkpoint_info(&self) -> RpcResult<CheckpointInfoRes> {
212 let maybe_checkpoint = self.state_query.clone().get_latest_checkpoint().await;
213
214 let (Some((checkpoint, _)), epoch) = maybe_checkpoint else {
215 return Err(RpcError::CheckpointNotFound.into());
216 };
217

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected