mirror of
https://github.com/hinto-janai/cuprate.git
synced 2025-01-24 19:35:57 +00:00
remove blockchain write handle, fix docs
This commit is contained in:
parent
e7f052f1d0
commit
2228d4d741
3 changed files with 10 additions and 12 deletions
|
@ -102,17 +102,14 @@ pub struct CupratedRpcHandler {
|
||||||
/// Read handle to the blockchain database.
|
/// Read handle to the blockchain database.
|
||||||
pub blockchain_read: BlockchainReadHandle,
|
pub blockchain_read: BlockchainReadHandle,
|
||||||
|
|
||||||
/// Write handle to the blockchain database.
|
|
||||||
pub blockchain_write: BlockchainWriteHandle,
|
|
||||||
|
|
||||||
/// Handle to the blockchain manager.
|
/// Handle to the blockchain manager.
|
||||||
pub blockchain_manager: BlockchainManagerHandle,
|
pub blockchain_manager: BlockchainManagerHandle,
|
||||||
|
|
||||||
/// Read handle to the transaction pool database.
|
/// Read handle to the transaction pool database.
|
||||||
pub txpool_read: TxpoolReadHandle,
|
pub txpool_read: TxpoolReadHandle,
|
||||||
|
|
||||||
/// Write handle to the transaction pool database.
|
/// TODO: handle to txpool service.
|
||||||
pub txpool_write: TxpoolWriteHandle,
|
pub txpool_manager: std::convert::Infallible,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CupratedRpcHandler {
|
impl CupratedRpcHandler {
|
||||||
|
@ -120,18 +117,16 @@ impl CupratedRpcHandler {
|
||||||
pub const fn new(
|
pub const fn new(
|
||||||
restricted: bool,
|
restricted: bool,
|
||||||
blockchain_read: BlockchainReadHandle,
|
blockchain_read: BlockchainReadHandle,
|
||||||
blockchain_write: BlockchainWriteHandle,
|
|
||||||
blockchain_manager: BlockchainManagerHandle,
|
blockchain_manager: BlockchainManagerHandle,
|
||||||
txpool_read: TxpoolReadHandle,
|
txpool_read: TxpoolReadHandle,
|
||||||
txpool_write: TxpoolWriteHandle,
|
txpool_manager: std::convert::Infallible,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
restricted,
|
restricted,
|
||||||
blockchain_read,
|
blockchain_read,
|
||||||
blockchain_write,
|
|
||||||
blockchain_manager,
|
blockchain_manager,
|
||||||
txpool_read,
|
txpool_read,
|
||||||
txpool_write,
|
txpool_manager,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,11 @@
|
||||||
//!
|
//!
|
||||||
//! The 2nd allows any caller to send [`WriteRequest`][req_w]s.
|
//! The 2nd allows any caller to send [`WriteRequest`][req_w]s.
|
||||||
//!
|
//!
|
||||||
|
//! The [`BlockchainReadHandle`] can be shared as it is cheaply [`Clone`]able.
|
||||||
|
//!
|
||||||
|
//! Although [`BlockchainWriteHandle`] can also be cloned, there is only 1 place
|
||||||
|
//! in Cuprate that writes (the blockchain manager), so it is passed there and used.
|
||||||
|
//!
|
||||||
//! ## Initialization
|
//! ## Initialization
|
||||||
//! The database & thread-pool system can be initialized with [`init()`].
|
//! The database & thread-pool system can be initialized with [`init()`].
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -21,9 +21,7 @@
|
||||||
//!
|
//!
|
||||||
//! The 2nd allows any caller to send [`WriteRequest`][req_w]s.
|
//! The 2nd allows any caller to send [`WriteRequest`][req_w]s.
|
||||||
//!
|
//!
|
||||||
//! The `DatabaseReadHandle` can be shared as it is cheaply [`Clone`]able, however,
|
//! Both the handles are cheaply [`Clone`]able.
|
||||||
//! the `DatabaseWriteHandle` cannot be cloned. There is only 1 place in Cuprate that
|
|
||||||
//! writes, so it is passed there and used.
|
|
||||||
//!
|
//!
|
||||||
//! ## Initialization
|
//! ## Initialization
|
||||||
//! The database & thread-pool system can be initialized with [`init()`].
|
//! The database & thread-pool system can be initialized with [`init()`].
|
||||||
|
|
Loading…
Reference in a new issue