From d87286c5c311dc37034933d9f14da5237c3d44a3 Mon Sep 17 00:00:00 2001 From: debris Date: Fri, 18 Mar 2016 19:16:46 +0100 Subject: [PATCH] updated rpc helpers docs --- rpc/src/v1/tests/helpers/account_provider.rs | 3 +++ rpc/src/v1/tests/helpers/external_miner.rs | 1 + rpc/src/v1/tests/helpers/miner_service.rs | 5 +++++ rpc/src/v1/tests/helpers/sync_provider.rs | 7 +++++++ 4 files changed, 16 insertions(+) diff --git a/rpc/src/v1/tests/helpers/account_provider.rs b/rpc/src/v1/tests/helpers/account_provider.rs index ce5b76b44..9cbf853ae 100644 --- a/rpc/src/v1/tests/helpers/account_provider.rs +++ b/rpc/src/v1/tests/helpers/account_provider.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +//! Test implementation of account provider. + use std::sync::RwLock; use std::collections::HashMap; use std::io; @@ -42,6 +44,7 @@ impl TestAccount { /// Test account provider. pub struct TestAccountProvider { accounts: RwLock>, + /// Added accounts passwords. pub adds: RwLock>, } diff --git a/rpc/src/v1/tests/helpers/external_miner.rs b/rpc/src/v1/tests/helpers/external_miner.rs index a5111b302..ef3714440 100644 --- a/rpc/src/v1/tests/helpers/external_miner.rs +++ b/rpc/src/v1/tests/helpers/external_miner.rs @@ -26,6 +26,7 @@ pub struct TestExternalMiner { } impl TestExternalMiner { + /// Creates new external miner. pub fn new(hashrates: Arc>>) -> Self { TestExternalMiner { hashrates: hashrates, diff --git a/rpc/src/v1/tests/helpers/miner_service.rs b/rpc/src/v1/tests/helpers/miner_service.rs index ad9dcaedd..22e210392 100644 --- a/rpc/src/v1/tests/helpers/miner_service.rs +++ b/rpc/src/v1/tests/helpers/miner_service.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +//! Test implementation of miner service. + use util::{Address, H256, Bytes}; use util::standard::*; use ethcore::error::Error; @@ -22,8 +24,11 @@ use ethcore::block::ClosedBlock; use ethcore::transaction::SignedTransaction; use ethminer::{MinerService, MinerStatus, AccountDetails}; +/// Test miner service. pub struct TestMinerService { + /// Imported transactions. pub imported_transactions: RwLock>, + /// Latest closed block. pub latest_closed_block: Mutex>, } diff --git a/rpc/src/v1/tests/helpers/sync_provider.rs b/rpc/src/v1/tests/helpers/sync_provider.rs index 5b4b5b099..222c4c7b9 100644 --- a/rpc/src/v1/tests/helpers/sync_provider.rs +++ b/rpc/src/v1/tests/helpers/sync_provider.rs @@ -14,15 +14,22 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +//! Test implementation of SyncProvider. + use ethsync::{SyncProvider, SyncStatus, SyncState}; use std::sync::{RwLock}; +/// TestSyncProvider config. pub struct Config { + /// Protocol version. pub protocol_version: u8, + /// Number of peers. pub num_peers: usize, } +/// Test sync provider. pub struct TestSyncProvider { + /// Sync status. pub status: RwLock, }