Skip to content

Commit

Permalink
remove api and rely on consensus task instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jparr721 committed Mar 28, 2024
1 parent c878b47 commit 9d86916
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 567 deletions.
8 changes: 2 additions & 6 deletions crates/hotshot/src/tasks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,8 @@ pub async fn inject_consensus_polls<
}

/// Setup polls for the given `quorum_proposal`.
pub async fn inject_quorum_proposal_polls<
TYPES: NodeType,
I: NodeImplementation<TYPES>,
A: ConsensusApi<TYPES, I>,
>(
quorum_proposal_task_state: &QuorumProposalTaskState<TYPES, I, A>,
pub async fn inject_quorum_proposal_polls<TYPES: NodeType, I: NodeImplementation<TYPES>>(
quorum_proposal_task_state: &QuorumProposalTaskState<TYPES, I>,
) {
// Poll (forever) for the latest quorum proposal
quorum_proposal_task_state
Expand Down
5 changes: 2 additions & 3 deletions crates/hotshot/src/tasks/task_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> CreateTaskState<TYPES, I>

#[async_trait]
impl<TYPES: NodeType, I: NodeImplementation<TYPES>> CreateTaskState<TYPES, I>
for QuorumProposalTaskState<TYPES, I, SystemContextHandle<TYPES, I>>
for QuorumProposalTaskState<TYPES, I>
{
async fn create_from(
handle: &SystemContextHandle<TYPES, I>,
) -> QuorumProposalTaskState<TYPES, I, SystemContextHandle<TYPES, I>> {
) -> QuorumProposalTaskState<TYPES, I> {
let consensus = handle.hotshot.get_consensus();
QuorumProposalTaskState {
latest_proposed_view: handle.get_cur_view().await,
Expand All @@ -229,7 +229,6 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> CreateTaskState<TYPES, I>
timeout_task: None,
public_key: handle.public_key().clone(),
timeout: handle.hotshot.config.next_view_timeout,
api: handle.clone(),
id: handle.hotshot.id,
}
}
Expand Down
Loading

0 comments on commit 9d86916

Please sign in to comment.