Skip to content

Commit

Permalink
Implement work for EthApi (#36)
Browse files Browse the repository at this point in the history
* Implement work for EthApi

* Default response for EthApi::work
  • Loading branch information
tgmichel authored Jun 15, 2020
1 parent 949fe2a commit f481e0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rpc/core/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub trait EthApi {

/// Returns the hash of the current block, the seedHash, and the boundary condition to be met.
#[rpc(name = "eth_getWork")]
fn work(&self, _: Option<u64>) -> Result<Work>;
fn work(&self) -> Result<Work>;

/// Used for submitting a proof-of-work solution.
#[rpc(name = "eth_submitWork")]
Expand Down
9 changes: 7 additions & 2 deletions rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,13 @@ impl<B, C, SC, P, CT, BE> EthApiT for EthApi<B, C, SC, P, CT, BE> where
unimplemented!("logs");
}

fn work(&self, _: Option<u64>) -> Result<Work> {
unimplemented!("work");
fn work(&self) -> Result<Work> {
Ok(Work {
pow_hash: H256::default(),
seed_hash: H256::default(),
target: H256::default(),
number: None,
})
}

fn submit_work(&self, _: H64, _: H256, _: H256) -> Result<bool> {
Expand Down

0 comments on commit f481e0d

Please sign in to comment.