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

Commit

Permalink
Add test, additional fix.
Browse files Browse the repository at this point in the history
Fixes #1932.
  • Loading branch information
gavofyork committed Aug 16, 2016
1 parent c6f8d54 commit 2b2282e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
1 change: 0 additions & 1 deletion ethcore/src/client/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.


use std::mem;
use std::collections::{BTreeMap, VecDeque};
use util::{U256, Address, H256, H2048, Bytes, Itertools};
Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/miner/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ impl MinerService for Miner {
gas_used: receipt.gas_used - prev_gas,
contract_address: match tx.action {
Action::Call(_) => None,
Action::Create => Some(contract_address(&tx.sender().unwrap(), &tx.nonce))
Action::Create => Some(contract_address(&tx.sender().unwrap(), &tx.nonce)),
},
logs: receipt.logs.clone(),
}
Expand Down
9 changes: 9 additions & 0 deletions ethcore/src/tests/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

use io::IoChannel;
use client::{BlockChainClient, MiningBlockChainClient, Client, ClientConfig, BlockID};
use ethereum;
use block::IsBlock;
use tests::helpers::*;
use common::*;
Expand All @@ -31,6 +32,14 @@ fn imports_from_empty() {
client.flush_queue();
}

#[test]
fn should_return_registrar() {
let dir = RandomTempPath::new();
let spec = ethereum::new_morden();
let client = Client::new(ClientConfig::default(), &spec, dir.as_path(), Arc::new(Miner::with_spec(&spec)), IoChannel::disconnected()).unwrap();
assert_eq!(client.additional_params().get("registrar"), Some(&"8e4e9b13d4b45cb0befc93c3061b1408f67316b2".to_owned()));
}

#[test]
fn returns_state_root_basic() {
let client_result = generate_dummy_client(6);
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/impls/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl<C, S: ?Sized, M, EM> EthClient<C, S, M, EM> where
let view = block_view.header_view();
let block = Block {
hash: Some(view.sha3().into()),
size: Some(bytes.len()),
size: Some(bytes.len().into()),
parent_hash: view.parent_hash().into(),
uncles_hash: view.uncles_hash().into(),
author: view.author().into(),
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/types/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub struct Block {
/// Transactions
pub transactions: BlockTransactions,
/// Size in bytes
pub size: Option<usize>,
pub size: Option<U256>,
}

#[cfg(test)]
Expand Down

0 comments on commit 2b2282e

Please sign in to comment.