Skip to content

Commit

Permalink
Fix message-compat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tbro committed Jan 8, 2025
1 parent 13a3260 commit 8f2d3a4
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions sequencer/src/message_compat_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ use hotshot_types::{
DaConsensusMessage, DataMessage, GeneralConsensusMessage, Message, MessageKind, Proposal,
SequencingMessage,
},
simple_certificate::{
DaCertificate, QuorumCertificate, UpgradeCertificate, ViewSyncCommitCertificate2,
ViewSyncFinalizeCertificate2, ViewSyncPreCommitCertificate2,
},
simple_certificate::{DaCertificate, QuorumCertificate, UpgradeCertificate},
simple_vote::{DaData, DaVote, QuorumData, QuorumVote, UpgradeProposalData, UpgradeVote},
traits::{
node_implementation::ConsensusTime, signature_key::SignatureKey, BlockPayload, EncodeBytes,
Expand All @@ -53,11 +50,14 @@ async fn test_message_compat<Ver: StaticVersionType>(_ver: Ver) {
use espresso_types::{EpochCommittees, Leaf, Payload, SeqTypes, Transaction};
use hotshot_example_types::node_types::TestVersions;
use hotshot_types::{
simple_certificate::TimeoutCertificate2,
simple_certificate::{
TimeoutCertificate2, ViewSyncCommitCertificate, ViewSyncFinalizeCertificate,
ViewSyncPreCommitCertificate,
},
simple_vote::{
TimeoutData2, TimeoutVote2, ViewSyncCommitData2, ViewSyncCommitVote2,
ViewSyncFinalizeData2, ViewSyncFinalizeVote2, ViewSyncPreCommitData2,
ViewSyncPreCommitVote2,
TimeoutData, TimeoutData2, TimeoutVote, ViewSyncCommitData, ViewSyncCommitVote,
ViewSyncFinalizeData, ViewSyncFinalizeVote, ViewSyncPreCommitData,
ViewSyncPreCommitVote,
},
PeerConfig,
};
Expand Down Expand Up @@ -93,20 +93,17 @@ async fn test_message_compat<Ver: StaticVersionType>(_ver: Ver) {
)
.await
.unwrap();
let view_sync_pre_commit_data = ViewSyncPreCommitData2 {
let view_sync_pre_commit_data = ViewSyncPreCommitData {
relay: 0,
round: ViewNumber::genesis(),
epoch: EpochNumber::genesis(),
};
let view_sync_commit_data = ViewSyncCommitData2 {
let view_sync_commit_data = ViewSyncCommitData {
relay: 0,
round: ViewNumber::genesis(),
epoch: EpochNumber::genesis(),
};
let view_sync_finalize_data = ViewSyncFinalizeData2 {
let view_sync_finalize_data = ViewSyncFinalizeData {
relay: 0,
round: ViewNumber::genesis(),
epoch: EpochNumber::genesis(),
};
let timeout_data = TimeoutData2 {
view: ViewNumber::genesis(),
Expand Down Expand Up @@ -151,45 +148,47 @@ async fn test_message_compat<Ver: StaticVersionType>(_ver: Ver) {
},
view_number: ViewNumber::genesis(),
}),
GeneralConsensusMessage::ViewSyncPreCommitVote2(ViewSyncPreCommitVote2 {
GeneralConsensusMessage::ViewSyncPreCommitVote(ViewSyncPreCommitVote {
signature: (sender, signature.clone()),
data: view_sync_pre_commit_data.clone(),
view_number: ViewNumber::genesis(),
}),
GeneralConsensusMessage::ViewSyncCommitVote2(ViewSyncCommitVote2 {
GeneralConsensusMessage::ViewSyncCommitVote(ViewSyncCommitVote {
signature: (sender, signature.clone()),
data: view_sync_commit_data.clone(),
view_number: ViewNumber::genesis(),
}),
GeneralConsensusMessage::ViewSyncFinalizeVote2(ViewSyncFinalizeVote2 {
GeneralConsensusMessage::ViewSyncFinalizeVote(ViewSyncFinalizeVote {
signature: (sender, signature.clone()),
data: view_sync_finalize_data.clone(),
view_number: ViewNumber::genesis(),
}),
GeneralConsensusMessage::ViewSyncPreCommitCertificate2(ViewSyncPreCommitCertificate2::new(
GeneralConsensusMessage::ViewSyncPreCommitCertificate(ViewSyncPreCommitCertificate::new(
view_sync_pre_commit_data.clone(),
view_sync_pre_commit_data.commit(),
ViewNumber::genesis(),
Default::default(),
Default::default(),
)),
GeneralConsensusMessage::ViewSyncCommitCertificate2(ViewSyncCommitCertificate2::new(
GeneralConsensusMessage::ViewSyncCommitCertificate(ViewSyncCommitCertificate::new(
view_sync_commit_data.clone(),
view_sync_commit_data.commit(),
ViewNumber::genesis(),
Default::default(),
Default::default(),
)),
GeneralConsensusMessage::ViewSyncFinalizeCertificate2(ViewSyncFinalizeCertificate2::new(
GeneralConsensusMessage::ViewSyncFinalizeCertificate(ViewSyncFinalizeCertificate::new(
view_sync_finalize_data.clone(),
view_sync_finalize_data.commit(),
ViewNumber::genesis(),
Default::default(),
Default::default(),
)),
GeneralConsensusMessage::TimeoutVote2(TimeoutVote2 {
GeneralConsensusMessage::TimeoutVote(TimeoutVote {
signature: (sender, signature.clone()),
data: timeout_data,
data: TimeoutData {
view: ViewNumber::genesis(),
},
view_number: ViewNumber::genesis(),
}),
GeneralConsensusMessage::UpgradeProposal(Proposal {
Expand Down

0 comments on commit 8f2d3a4

Please sign in to comment.