Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Return storage as H256 from RPC. (#1774)
Browse files Browse the repository at this point in the history
* Return storage as H256 from RPC.

* Fix test.
  • Loading branch information
gavofyork authored Jul 30, 2016
1 parent b672d51 commit b29329c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rpc/src/v1/impls/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ impl<C, S: ?Sized, M, EM> Eth for EthClient<C, S, M, EM> where
match block_number {
BlockNumber::Pending => to_value(&RpcU256::from(take_weak!(self.miner).storage_at(&*take_weak!(self.client), &address, &H256::from(position)))),
id => match take_weak!(self.client).storage_at(&address, &H256::from(position), id.into()) {
Some(s) => to_value(&RpcU256::from(s)),
Some(s) => to_value(&RpcH256::from(s)),
None => Err(make_unsupported_err()), // None is only returned on unsupported requests.
}
}
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/tests/mocked/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ fn rpc_eth_storage_at() {
"params": ["0x0000000000000000000000000000000000000001", "0x4", "latest"],
"id": 1
}"#;
let response = r#"{"jsonrpc":"2.0","result":"0x07","id":1}"#;
let response = r#"{"jsonrpc":"2.0","result":"0x0000000000000000000000000000000000000000000000000000000000000007","id":1}"#;

assert_eq!(tester.io.handle_request(request), Some(response.to_owned()));
}
Expand Down

0 comments on commit b29329c

Please sign in to comment.