reorganize modules for consistency
This commit is contained in:
parent
4953f21670
commit
a122a547be
|
|
@ -14,16 +14,12 @@ mod error;
|
||||||
mod request;
|
mod request;
|
||||||
mod response;
|
mod response;
|
||||||
mod service;
|
mod service;
|
||||||
mod sled_state;
|
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
// TODO: move these to integration tests.
|
// TODO: move these to integration tests.
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
use service::QueuedBlock;
|
|
||||||
use sled_state::FinalizedState;
|
|
||||||
|
|
||||||
pub use config::Config;
|
pub use config::Config;
|
||||||
pub use constants::MAX_BLOCK_REORG_HEIGHT;
|
pub use constants::MAX_BLOCK_REORG_HEIGHT;
|
||||||
pub use error::{BoxError, CloneError, CommitBlockError, ValidateContextError};
|
pub use error::{BoxError, CloneError, CommitBlockError, ValidateContextError};
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use futures::future::FutureExt;
|
use futures::future::FutureExt;
|
||||||
use memory_state::{NonFinalizedState, QueuedBlocks};
|
use non_finalized_state::{NonFinalizedState, QueuedBlocks};
|
||||||
use tokio::sync::oneshot;
|
use tokio::sync::oneshot;
|
||||||
use tower::{util::BoxService, Service};
|
use tower::{util::BoxService, Service};
|
||||||
use tracing::instrument;
|
use tracing::instrument;
|
||||||
|
|
@ -21,12 +21,15 @@ use zebra_chain::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
request::HashOrHeight, BoxError, CommitBlockError, Config, FinalizedState, Request, Response,
|
request::HashOrHeight, BoxError, CommitBlockError, Config, Request, Response,
|
||||||
ValidateContextError,
|
ValidateContextError,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use self::finalized_state::FinalizedState;
|
||||||
|
|
||||||
mod check;
|
mod check;
|
||||||
mod memory_state;
|
mod finalized_state;
|
||||||
|
mod non_finalized_state;
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
mod utxo;
|
mod utxo;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! The primary implementation of the `zebra_state::Service` built upon sled
|
//! The primary implementation of the `zebra_state::Service` built upon sled
|
||||||
|
|
||||||
|
mod sled_format;
|
||||||
|
|
||||||
use std::{collections::HashMap, convert::TryInto, sync::Arc};
|
use std::{collections::HashMap, convert::TryInto, sync::Arc};
|
||||||
|
|
||||||
use zebra_chain::transparent;
|
use zebra_chain::transparent;
|
||||||
|
|
@ -9,13 +11,11 @@ use zebra_chain::{
|
||||||
transaction::{self, Transaction},
|
transaction::{self, Transaction},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{BoxError, Config, HashOrHeight, QueuedBlock};
|
use crate::{BoxError, Config, HashOrHeight};
|
||||||
|
|
||||||
mod sled_format;
|
use self::sled_format::{FromSled, IntoSled, SledDeserialize, SledSerialize, TransactionLocation};
|
||||||
|
|
||||||
use sled_format::{FromSled, IntoSled, SledDeserialize, SledSerialize};
|
use super::QueuedBlock;
|
||||||
|
|
||||||
use self::sled_format::TransactionLocation;
|
|
||||||
|
|
||||||
/// The finalized part of the chain state, stored in sled.
|
/// The finalized part of the chain state, stored in sled.
|
||||||
///
|
///
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
//! Non-finalized chain state management as defined by [RFC0005]
|
|
||||||
//!
|
|
||||||
//! [RFC0005]: https://zebra.zfnd.org/dev/rfcs/0005-state-updates.html
|
|
||||||
|
|
||||||
mod chain;
|
|
||||||
mod non_finalized_state;
|
|
||||||
mod queued_blocks;
|
|
||||||
|
|
||||||
use chain::Chain;
|
|
||||||
pub use non_finalized_state::NonFinalizedState;
|
|
||||||
pub use queued_blocks::QueuedBlocks;
|
|
||||||
|
|
@ -1,3 +1,12 @@
|
||||||
|
//! Non-finalized chain state management as defined by [RFC0005]
|
||||||
|
//!
|
||||||
|
//! [RFC0005]: https://zebra.zfnd.org/dev/rfcs/0005-state-updates.html
|
||||||
|
|
||||||
|
mod chain;
|
||||||
|
mod queued_blocks;
|
||||||
|
|
||||||
|
pub use queued_blocks::QueuedBlocks;
|
||||||
|
|
||||||
use std::{collections::BTreeSet, mem, ops::Deref, sync::Arc};
|
use std::{collections::BTreeSet, mem, ops::Deref, sync::Arc};
|
||||||
|
|
||||||
use zebra_chain::{
|
use zebra_chain::{
|
||||||
|
|
@ -8,7 +17,7 @@ use zebra_chain::{
|
||||||
|
|
||||||
use crate::request::HashOrHeight;
|
use crate::request::HashOrHeight;
|
||||||
|
|
||||||
use super::Chain;
|
use self::chain::Chain;
|
||||||
|
|
||||||
/// The state of the chains in memory, incuding queued blocks.
|
/// The state of the chains in memory, incuding queued blocks.
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
Loading…
Reference in New Issue