diff --git a/validator/src/network/ethereum.rs b/validator/src/network/ethereum.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/validator/src/network/mod.rs b/validator/src/network/mod.rs index 30db3a456d..cc58e96b21 100644 --- a/validator/src/network/mod.rs +++ b/validator/src/network/mod.rs @@ -1 +1,4 @@ +//! The `network` module provides interfaces to external systems via network +//! connectivity. +//! pub mod tendermint_abci; diff --git a/validator/src/network/tendermint_abci/mod.rs b/validator/src/network/tendermint_abci.rs similarity index 84% rename from validator/src/network/tendermint_abci/mod.rs rename to validator/src/network/tendermint_abci.rs index 69f859bd9e..90236fbe9a 100644 --- a/validator/src/network/tendermint_abci/mod.rs +++ b/validator/src/network/tendermint_abci.rs @@ -1,17 +1,9 @@ +use crate::validator::Validator; use abci::*; use byteorder::{BigEndian, ByteOrder}; - -// Simple counter application. Its only state is a u64 count -// We use BigEndian to serialize the data across transactions calls -pub struct CounterApp { - count: u64, -} - -impl CounterApp { - pub fn new() -> CounterApp { - CounterApp { count: 0 } - } -} +use crypto::identity::{ + DummyMixIdentityKeyPair, DummyMixIdentityPrivateKey, DummyMixIdentityPublicKey, +}; // Convert incoming tx data to the proper BigEndian size. txs.len() > 8 will return 0 fn convert_tx(tx: &[u8]) -> u64 { @@ -24,7 +16,9 @@ fn convert_tx(tx: &[u8]) -> u64 { BigEndian::read_u64(tx) } -impl abci::Application for CounterApp { +impl abci::Application + for Validator +{ // Validate transactions. Rule: Transactions must be incremental: 1,2,3,4... fn check_tx(&mut self, req: &RequestCheckTx) -> ResponseCheckTx { // Get the Tx [u8] and convert to u64