Skip to content

Commit

Permalink
Bump up version and remove unused code from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
devashishdxt committed Mar 21, 2022
1 parent 0747a0d commit 29855c4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "abci-rs"
version = "0.11.1"
version = "0.11.2"
authors = ["Devashish Dixit <[email protected]>"]
license = "MIT/Apache-2.0"
description = "A Rust crate for creating ABCI applications"
Expand Down
14 changes: 3 additions & 11 deletions examples/async-counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,7 @@ impl Consensus for ConsensusConnection {
}

#[derive(Debug)]
pub struct MempoolConnection {
state: Arc<Mutex<Option<CounterState>>>,
}

impl MempoolConnection {
pub fn new(state: Arc<Mutex<Option<CounterState>>>) -> Self {
Self { state }
}
}
pub struct MempoolConnection;

#[async_trait]
impl Mempool for MempoolConnection {
Expand Down Expand Up @@ -191,8 +183,8 @@ pub fn server() -> Server<ConsensusConnection, MempoolConnection, InfoConnection
let committed_state: Arc<Mutex<CounterState>> = Default::default();
let current_state: Arc<Mutex<Option<CounterState>>> = Default::default();

let consensus = ConsensusConnection::new(committed_state.clone(), current_state.clone());
let mempool = MempoolConnection::new(current_state);
let consensus = ConsensusConnection::new(committed_state.clone(), current_state);
let mempool = MempoolConnection;
let info = InfoConnection::new(committed_state);
let snapshot = SnapshotConnection;

Expand Down
14 changes: 3 additions & 11 deletions examples/sync-counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,7 @@ impl Consensus for ConsensusConnection {
}

#[derive(Debug)]
pub struct MempoolConnection {
state: Arc<Mutex<Option<CounterState>>>,
}

impl MempoolConnection {
pub fn new(state: Arc<Mutex<Option<CounterState>>>) -> Self {
Self { state }
}
}
pub struct MempoolConnection;

impl Mempool for MempoolConnection {
fn check_tx(&self, check_tx_request: RequestCheckTx) -> ResponseCheckTx {
Expand Down Expand Up @@ -186,8 +178,8 @@ pub fn server() -> Server<ConsensusConnection, MempoolConnection, InfoConnection
let committed_state: Arc<Mutex<CounterState>> = Default::default();
let current_state: Arc<Mutex<Option<CounterState>>> = Default::default();

let consensus = ConsensusConnection::new(committed_state.clone(), current_state.clone());
let mempool = MempoolConnection::new(current_state);
let consensus = ConsensusConnection::new(committed_state.clone(), current_state);
let mempool = MempoolConnection;
let info = InfoConnection::new(committed_state);
let snapshot = SnapshotConnection;

Expand Down
18 changes: 5 additions & 13 deletions src/tests/counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,7 @@ impl Consensus for ConsensusConnection {
}

#[derive(Debug)]
pub struct MempoolConnection {
state: Arc<Mutex<Option<CounterState>>>,
}

impl MempoolConnection {
pub fn new(state: Arc<Mutex<Option<CounterState>>>) -> Self {
Self { state }
}
}
pub struct MempoolConnection;

#[async_trait]
impl Mempool for MempoolConnection {
Expand Down Expand Up @@ -177,8 +169,8 @@ pub fn server() -> Server<ConsensusConnection, MempoolConnection, InfoConnection
let committed_state: Arc<Mutex<CounterState>> = Default::default();
let current_state: Arc<Mutex<Option<CounterState>>> = Default::default();

let consensus = ConsensusConnection::new(committed_state.clone(), current_state.clone());
let mempool = MempoolConnection::new(current_state);
let consensus = ConsensusConnection::new(committed_state.clone(), current_state);
let mempool = MempoolConnection;
let info = InfoConnection::new(committed_state);
let snapshot = SnapshotConnection;

Expand All @@ -196,8 +188,8 @@ pub fn server_with_state(
}));
let current_state: Arc<Mutex<Option<CounterState>>> = Default::default();

let consensus = ConsensusConnection::new(committed_state.clone(), current_state.clone());
let mempool = MempoolConnection::new(current_state);
let consensus = ConsensusConnection::new(committed_state.clone(), current_state);
let mempool = MempoolConnection;
let info = InfoConnection::new(committed_state);
let snapshot = SnapshotConnection;

Expand Down

0 comments on commit 29855c4

Please sign in to comment.