updated rpc helpers docs
This commit is contained in:
parent
3b8c6a1ab2
commit
1c9cc6167d
@ -14,6 +14,8 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
//! Test implementation of account provider.
|
||||||
|
|
||||||
use std::sync::RwLock;
|
use std::sync::RwLock;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::io;
|
use std::io;
|
||||||
@ -42,6 +44,7 @@ impl TestAccount {
|
|||||||
/// Test account provider.
|
/// Test account provider.
|
||||||
pub struct TestAccountProvider {
|
pub struct TestAccountProvider {
|
||||||
accounts: RwLock<HashMap<Address, TestAccount>>,
|
accounts: RwLock<HashMap<Address, TestAccount>>,
|
||||||
|
/// Added accounts passwords.
|
||||||
pub adds: RwLock<Vec<String>>,
|
pub adds: RwLock<Vec<String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ pub struct TestExternalMiner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl TestExternalMiner {
|
impl TestExternalMiner {
|
||||||
|
/// Creates new external miner.
|
||||||
pub fn new(hashrates: Arc<RwLock<HashMap<H256, U256>>>) -> Self {
|
pub fn new(hashrates: Arc<RwLock<HashMap<H256, U256>>>) -> Self {
|
||||||
TestExternalMiner {
|
TestExternalMiner {
|
||||||
hashrates: hashrates,
|
hashrates: hashrates,
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
//! Test implementation of miner service.
|
||||||
|
|
||||||
use util::{Address, H256, Bytes};
|
use util::{Address, H256, Bytes};
|
||||||
use util::standard::*;
|
use util::standard::*;
|
||||||
use ethcore::error::Error;
|
use ethcore::error::Error;
|
||||||
@ -22,8 +24,11 @@ use ethcore::block::ClosedBlock;
|
|||||||
use ethcore::transaction::SignedTransaction;
|
use ethcore::transaction::SignedTransaction;
|
||||||
use ethminer::{MinerService, MinerStatus, AccountDetails};
|
use ethminer::{MinerService, MinerStatus, AccountDetails};
|
||||||
|
|
||||||
|
/// Test miner service.
|
||||||
pub struct TestMinerService {
|
pub struct TestMinerService {
|
||||||
|
/// Imported transactions.
|
||||||
pub imported_transactions: RwLock<Vec<H256>>,
|
pub imported_transactions: RwLock<Vec<H256>>,
|
||||||
|
/// Latest closed block.
|
||||||
pub latest_closed_block: Mutex<Option<ClosedBlock>>,
|
pub latest_closed_block: Mutex<Option<ClosedBlock>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,15 +14,22 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
//! Test implementation of SyncProvider.
|
||||||
|
|
||||||
use ethsync::{SyncProvider, SyncStatus, SyncState};
|
use ethsync::{SyncProvider, SyncStatus, SyncState};
|
||||||
use std::sync::{RwLock};
|
use std::sync::{RwLock};
|
||||||
|
|
||||||
|
/// TestSyncProvider config.
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
|
/// Protocol version.
|
||||||
pub protocol_version: u8,
|
pub protocol_version: u8,
|
||||||
|
/// Number of peers.
|
||||||
pub num_peers: usize,
|
pub num_peers: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Test sync provider.
|
||||||
pub struct TestSyncProvider {
|
pub struct TestSyncProvider {
|
||||||
|
/// Sync status.
|
||||||
pub status: RwLock<SyncStatus>,
|
pub status: RwLock<SyncStatus>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user