Skip to content

Commit c9b76d7

Browse files
committed
fixup! Add Commit message in Tendermint
1 parent 44c4034 commit c9b76d7

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

core/src/consensus/tendermint/message.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,43 @@ mod tests {
466466
});
467467
}
468468

469+
#[test]
470+
fn encode_and_decode_tendermint_message_6() {
471+
rlp_encode_and_decode_test!(TendermintMessage::RequestCommit {
472+
height: 3,
473+
});
474+
}
475+
476+
#[test]
477+
fn encode_and_decode_tendermint_message_7() {
478+
rlp_encode_and_decode_test!(TendermintMessage::Commit {
479+
height: 3,
480+
block: vec![1u8, 2u8],
481+
votes: vec![
482+
ConsensusMessage {
483+
signature: SchnorrSignature::random(),
484+
signer_index: 0x1234,
485+
on: VoteOn {
486+
step: VoteStep::new(2, 3, Step::Commit),
487+
block_hash: Some(H256::from(
488+
"07feab4c39250abf60b77d7589a5b61fdf409bd837e936376381d19db1e1f050"
489+
)),
490+
},
491+
},
492+
ConsensusMessage {
493+
signature: SchnorrSignature::random(),
494+
signer_index: 0x1235,
495+
on: VoteOn {
496+
step: VoteStep::new(2, 3, Step::Commit),
497+
block_hash: Some(H256::from(
498+
"07feab4c39250abf60b77d7589a5b61fdf409bd837e936376381d19db1e1f050"
499+
)),
500+
},
501+
}
502+
]
503+
});
504+
}
505+
469506
#[test]
470507
fn encode_and_decode_consensus_message_1() {
471508
let message = ConsensusMessage::default();

core/src/consensus/tendermint/worker.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ impl Worker {
497497
self.proposal.is_none() && !self.step.is_commit()
498498
}
499499

500+
// FIXME: remove pub
500501
pub fn get_all_votes_and_authors(
501502
&self,
502503
vote_step: &VoteStep,

0 commit comments

Comments
 (0)