implement eth_sign

This commit is contained in:
Robert Habermeier
2016-05-29 15:46:57 +02:00
parent 7cea3eb5ed
commit be1ec93271
3 changed files with 30 additions and 18 deletions

View File

@@ -27,6 +27,7 @@ use jsonrpc_core::*;
use util::numbers::*;
use util::sha3::*;
use util::rlp::{encode, decode, UntrustedRlp, View};
use util::keys::store::AccountProvider;
use ethcore::client::{BlockChainClient, BlockID, TransactionID, UncleID};
use ethcore::block::IsBlock;
use ethcore::views::*;
@@ -39,7 +40,6 @@ use v1::traits::{Eth, EthFilter};
use v1::types::{Block, BlockTransactions, BlockNumber, Bytes, SyncStatus, SyncInfo, Transaction, TransactionRequest, CallRequest, OptionalValue, Index, Filter, Log, Receipt};
use v1::helpers::{PollFilter, PollManager};
use v1::impls::{dispatch_transaction, sign_and_dispatch};
use util::keys::store::AccountProvider;
use serde;
/// Eth rpc implementation.
@@ -495,12 +495,8 @@ impl<C, S, A, M, EM> Eth for EthClient<C, S, A, M, EM> where
}
fn sign(&self, params: Params) -> Result<Value, Error> {
from_params::<(Address, Bytes)>(params).and_then(|(addr, data)| {
let accounts = take_weak!(self.accounts);
match accounts.account_secret(&addr) {
Ok(secret) => rpc_unimplemented!(),
Err(_) => rpc_unimplemented!(),
}
from_params::<(Address, H256)>(params).and_then(|(addr, msg)| {
to_value(&take_weak!(self.accounts).sign(&addr, &msg).unwrap_or(H520::zero()))
})
}
@@ -553,15 +549,15 @@ impl<C, S, A, M, EM> Eth for EthClient<C, S, A, M, EM> where
})
}
fn compile_lll(&self, _: params) -> Result<Value, Error> {
fn compile_lll(&self, _: Params) -> Result<Value, Error> {
rpc_unimplemented!()
}
fn compile_serpent(&self, _: params) -> Result<Value, Error> {
fn compile_serpent(&self, _: Params) -> Result<Value, Error> {
rpc_unimplemented!()
}
fn compile_solidity(&self, _: params) -> Result<Value, Error> {
fn compile_solidity(&self, _: Params) -> Result<Value, Error> {
rpc_unimplemented!()
}
}