updated rpc helpers docs

This commit is contained in:
debris 2016-03-18 19:16:46 +01:00 committed by arkpar
parent ac3acdef71
commit d87286c5c3
4 changed files with 16 additions and 0 deletions

View File

@ -14,6 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! 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<HashMap<Address, TestAccount>>,
/// Added accounts passwords.
pub adds: RwLock<Vec<String>>,
}

View File

@ -26,6 +26,7 @@ pub struct TestExternalMiner {
}
impl TestExternalMiner {
/// Creates new external miner.
pub fn new(hashrates: Arc<RwLock<HashMap<H256, U256>>>) -> Self {
TestExternalMiner {
hashrates: hashrates,

View File

@ -14,6 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! 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<Vec<H256>>,
/// Latest closed block.
pub latest_closed_block: Mutex<Option<ClosedBlock>>,
}

View File

@ -14,15 +14,22 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! 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<SyncStatus>,
}