Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions finalizer/src/ingress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ impl<S: Scheme<B::Commitment>, B: ConsensusBlock + Committable> FinalizerMailbox
maybe_checkpoint
}

pub async fn get_finalized_header(&mut self, height: u64) -> Option<FinalizedHeader<S>> {
pub async fn get_finalized_header(&mut self, epoch: u64) -> Option<FinalizedHeader<S>> {
let (response, rx) = oneshot::channel();
let request = ConsensusStateRequest::GetFinalizedHeader(height);
let request = ConsensusStateRequest::GetFinalizedHeader(epoch);

let _ = self
.sender
Expand Down
8 changes: 4 additions & 4 deletions rpc/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ impl SummitApiServer for SummitRpcServer {
return Err(RpcError::CheckpointNotFound.into());
};

// try to get the finalized header for the last block
// try to get the finalized header for this epoch
let maybe_header = self
.finalizer_mailbox
.clone()
.get_finalized_header(last_block.height())
.get_finalized_header(epoch)
.await;

let Some(header) = maybe_header else {
Expand All @@ -89,11 +89,11 @@ impl SummitApiServer for SummitRpcServer {
return Err(RpcError::CheckpointNotFound.into());
};

// try to get the finalized header for the last block
// try to get the finalized header for this epoch
let maybe_header = self
.finalizer_mailbox
.clone()
.get_finalized_header(last_block.height())
.get_finalized_header(epoch)
.await;

let Some(header) = maybe_header else {
Expand Down
4 changes: 2 additions & 2 deletions types/src/consensus_state_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ impl<S: Scheme> ConsensusStateQuery<S> {
balance
}

pub async fn get_finalized_header(&self, height: u64) -> Option<FinalizedHeader<S>> {
pub async fn get_finalized_header(&self, epoch: u64) -> Option<FinalizedHeader<S>> {
let (tx, rx) = oneshot::channel();
let req = ConsensusStateRequest::GetFinalizedHeader(height);
let req = ConsensusStateRequest::GetFinalizedHeader(epoch);
let _ = self.sender.clone().send((req, tx)).await;

let res = rx
Expand Down