Simple signing queue, confirmation APIs exposed in signer WebSockets. (#1182)

* Splitting methods requiring signing into separate trait

* Single place where RPC apis are created.

* Separating eth_filter

* Separating eth_signing

* Stubs for Personal Signer methods

* Test for EthSigningQueueClient

* TransactionConfirmation API

* Exposing PersonalSigner API

* Defining ApiSets dependent on context

* Removing types

* Fixing default impl

* Fixing un-mocked tests

* Update signing_queue.rs

[ci skip]

* Removing unused import [ci skip]
This commit is contained in:
Tomasz Drwięga
2016-06-01 19:37:34 +02:00
committed by Gav Wood
parent b9b0ce8d65
commit 99e26b8480
35 changed files with 1140 additions and 544 deletions

View File

@@ -52,6 +52,7 @@ extern crate serde_json;
extern crate jsonrpc_core;
extern crate jsonrpc_http_server;
extern crate parity_dapps;
extern crate ethcore_rpc;
mod endpoint;
mod apps;
@@ -66,6 +67,7 @@ use std::net::SocketAddr;
use std::collections::HashMap;
use jsonrpc_core::{IoHandler, IoDelegate};
use router::auth::{Authorization, NoAuth, HttpBasicAuth};
use ethcore_rpc::Extendable;
static DAPPS_DOMAIN : &'static str = ".parity";
@@ -74,6 +76,12 @@ pub struct ServerBuilder {
handler: Arc<IoHandler>,
}
impl Extendable for ServerBuilder {
fn add_delegate<D: Send + Sync + 'static>(&self, delegate: IoDelegate<D>) {
self.handler.add_delegate(delegate);
}
}
impl ServerBuilder {
/// Construct new dapps server
pub fn new() -> Self {
@@ -82,11 +90,6 @@ impl ServerBuilder {
}
}
/// Add io delegate.
pub fn add_delegate<D>(&self, delegate: IoDelegate<D>) where D: Send + Sync + 'static {
self.handler.add_delegate(delegate);
}
/// Asynchronously start server with no authentication,
/// returns result with `Server` handle on success or an error.
pub fn start_unsecure_http(&self, addr: &SocketAddr) -> Result<Server, ServerError> {