Skip to content

Commit

Permalink
feat(mock-consensus): 🍰 EndBlock abci request height increases
Browse files Browse the repository at this point in the history
this patches the mock consensus `TestNode::end_block` method so that the
height of these requests does not stay at 1.

this is needed for staking tests, see #3995.

* #3588
* #4001
* #3995
* #3840
  • Loading branch information
cratelyn committed Mar 15, 2024
1 parent 6268a27 commit c5118f1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/test/mock-consensus/src/abci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use {
super::TestNode,
anyhow::anyhow,
anyhow::{anyhow, Context},
bytes::Bytes,
tap::{Tap, TapFallible},
tendermint::{
Expand Down Expand Up @@ -110,7 +110,13 @@ where
/// Sends a [`ConsensusRequest::EndBlock`] request to the ABCI application.
#[instrument(level = "debug", skip_all)]
pub async fn end_block(&mut self) -> Result<response::EndBlock, anyhow::Error> {
let request = ConsensusRequest::EndBlock(request::EndBlock { height: 1 });
let height = self
.height
.value()
.try_into()
.context("converting height into `i64`")?;
let request = ConsensusRequest::EndBlock(request::EndBlock { height });

let service = self.service().await?;
match service
.call(request)
Expand Down

0 comments on commit c5118f1

Please sign in to comment.