Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #135

Merged
merged 11 commits into from
Nov 17, 2024
Merged
2 changes: 1 addition & 1 deletion bin/oe/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use parity_rpc::{
};
use parity_runtime::Executor;

pub use parity_rpc::{HttpServer, IpcServer, RequestMiddleware};
pub use parity_rpc::{HttpServer, IpcServer};
//pub use parity_rpc::ws::Server as WsServer;
pub use parity_rpc::ws::{ws, Server as WsServer};

Expand Down
2 changes: 1 addition & 1 deletion crates/accounts/ethstore/src/account/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mod version;
pub use self::{
cipher::{Aes128Ctr, Cipher},
crypto::Crypto,
kdf::{Kdf, Pbkdf2, Prf, Scrypt},
kdf::{Kdf, Pbkdf2, Prf},
safe_account::SafeAccount,
version::Version,
};
4 changes: 2 additions & 2 deletions crates/accounts/ethstore/src/json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ mod version;
pub use self::{
bytes::Bytes,
cipher::{Aes128Ctr, Cipher, CipherSer, CipherSerParams},
crypto::{CipherText, Crypto},
crypto::Crypto,
error::Error,
hash::{H128, H160, H256},
id::Uuid,
kdf::{Kdf, KdfSer, KdfSerParams, Pbkdf2, Prf, Scrypt},
key_file::{KeyFile, OpaqueKeyFile},
presale::{Encseed, PresaleWallet},
presale::PresaleWallet,
vault_file::VaultFile,
vault_key_file::{
insert_vault_name_to_json_meta, remove_vault_name_from_json_meta, VaultKeyFile,
Expand Down
4 changes: 1 addition & 3 deletions crates/concensus/ethash/src/keccak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,5 @@ pub mod keccak_512 {
pub mod keccak_256 {
use super::hash;

pub use self::hash::{
keccak256 as inplace, keccak256_range as inplace_range, keccak_256 as write,
};
pub use self::hash::{keccak256 as inplace, keccak_256 as write};
}
3 changes: 1 addition & 2 deletions crates/ethcore/benches/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ impl<'a> BuiltinBenchmark<'a> {

let builtin = builtins
.get(&H160::from_str(builtin_address).unwrap())
.unwrap()
.clone();
.unwrap();
let input = FromHex::from_hex(input).unwrap();
let expected = FromHex::from_hex(expected).unwrap();

Expand Down
5 changes: 1 addition & 4 deletions crates/ethcore/src/engines/hbbft/contracts/keygen_history.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
use client::traits::EngineClient;
use crypto::{
self,
publickey::{ec_math_utils::public_add, Public},
};
use crypto::{self, publickey::Public};
use engines::{
hbbft::{
contracts::validator_set::{get_validator_pubkeys, ValidatorType},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ pub(crate) struct HbbftEarlyEpochEndManager {

node_id_to_address: BTreeMap<NodeId, Address>,

address_to_node_id: BTreeMap<Address, NodeId>,

// address_to_node_id: BTreeMap<Address, NodeId>,
signing_address: Address,
}

Expand Down Expand Up @@ -109,7 +108,7 @@ impl HbbftEarlyEpochEndManager {
validators: validators,
flagged_validators: flagged_validators,
node_id_to_address,
address_to_node_id,
// address_to_node_id,
signing_address: signing_address.clone(),
};

Expand Down
3 changes: 0 additions & 3 deletions crates/ethcore/src/engines/hbbft/hbbft_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1175,9 +1175,6 @@ impl HoneyBadgerBFT {
Err(e) => {
error!(target: "consensus", "Error initializing synckeygen: {:?}", e);
}
Err(_) => {
error!(target: "consensus", "Error initializing synckeygen: unknown Error");
}
}
}
}
Expand Down
12 changes: 3 additions & 9 deletions crates/ethcore/src/engines/hbbft/hbbft_network_fork_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,11 @@ impl HbbftNetworkForkManager {
#[cfg(test)]
mod tests {

use std::{fs, str::FromStr};

use crate::engines::{hbbft::test::hbbft_test_client::HbbftTestClient, signer::from_keypair};

use super::*;
use ethereum_types::Address;
use ethjson::spec::hbbft::HbbftNetworkFork;
use hbbft::sync_key_gen::{Ack, Part};

use crate::engines::signer::from_keypair;
use crypto::publickey::{KeyPair, Secret};
//use parity_crypto::publickey::{KeyPair, Secret};
use ethjson::spec::hbbft::HbbftNetworkFork;
use std::str::FromStr;

#[test]
fn test_fork_manager_should_fork() {
Expand Down
4 changes: 1 addition & 3 deletions crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
ethereum::public_key_to_address::public_key_to_address,
};

use super::{contracts::staking::get_pool_public_key, NodeId};
use bytes::ToPretty;

use ethereum_types::Address;

use super::{contracts::staking::get_pool_public_key, NodeId};

#[derive(Clone, Debug)]
struct ValidatorConnectionData {
// mining_address: Address,
staking_address: Address,

Check warning on line 19 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Test and Build (ubuntu-latest, 1.72)

fields `staking_address`, `socket_addr`, and `public_key` are never read

Check warning on line 19 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Test and Build (ubuntu-latest, 1.72)

fields `staking_address`, `socket_addr`, and `public_key` are never read

Check warning on line 19 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Check

fields `staking_address`, `socket_addr`, and `public_key` are never read

Check warning on line 19 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Check

fields `staking_address`, `socket_addr`, and `public_key` are never read

Check warning on line 19 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Check

fields `staking_address`, `socket_addr`, and `public_key` are never read
socket_addr: SocketAddr,
public_key: NodeId,
peer_string: String,
Expand Down Expand Up @@ -301,7 +299,7 @@
/// because those should be current validators by now.
/// Make sure to connect to the new current validators,
/// before disconnecting from the pending validators.
pub fn disconnect_pending_validators(

Check warning on line 302 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Test and Build (ubuntu-latest, 1.72)

method `disconnect_pending_validators` is never used

Check warning on line 302 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Test and Build (ubuntu-latest, 1.72)

method `disconnect_pending_validators` is never used

Check warning on line 302 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Check

method `disconnect_pending_validators` is never used

Check warning on line 302 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Check

method `disconnect_pending_validators` is never used

Check warning on line 302 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Check

method `disconnect_pending_validators` is never used
&mut self,
client: &dyn BlockChainClient,
) -> Result<usize, String> {
Expand Down
4 changes: 2 additions & 2 deletions crates/ethcore/src/engines/validator_set/safe_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ mod tests {
use types::{header::Header, log_entry::LogEntry};

let client = generate_dummy_client_with_spec(Spec::new_validator_safe_contract);
let engine = client.engine().clone();
let engine = client.engine();
let validator_contract = "0000000000000000000000000000000000000005"
.parse::<Address>()
.unwrap();
Expand Down Expand Up @@ -900,7 +900,7 @@ mod tests {
use types::header::Header;

let client = generate_dummy_client_with_spec(Spec::new_validator_safe_contract);
let engine = client.engine().clone();
let engine = client.engine();

let mut new_header = Header::default();
new_header.set_number(0); // so the validator set doesn't look for a log
Expand Down
1 change: 0 additions & 1 deletion crates/rpc/src/v1/helpers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ mod subscription_manager;
mod work;

pub use self::{
dispatch::{Dispatcher, FullDispatcher},
network_settings::NetworkSettings,
poll_filter::{limit_logs, PollFilter, SyncPollFilter},
poll_manager::PollManager,
Expand Down
3 changes: 2 additions & 1 deletion crates/rpc/src/v1/tests/mocked/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
helpers::{
dispatch,
external_signer::{SignerService, SigningQueue},
nonce, FullDispatcher,
nonce,
},
impls::SigningQueueClient,
metadata::Metadata,
Expand All @@ -30,6 +30,7 @@
types::{ConfirmationResponse, RichRawTransaction},
};

use crate::dispatch::FullDispatcher;
use accounts::AccountProvider;
use bytes::ToPretty;
use crypto::publickey::{Generator, Random, Secret};
Expand All @@ -41,7 +42,7 @@
use types::transaction::{Action, SignedTransaction, Transaction, TypedTransaction};

struct SigningTester {
pub runtime: Runtime,

Check warning on line 45 in crates/rpc/src/v1/tests/mocked/signing.rs

View workflow job for this annotation

GitHub Actions / Test and Build (ubuntu-latest, 1.72)

fields `runtime` and `client` are never read
pub signer: Arc<SignerService>,
pub client: Arc<TestBlockChainClient>,
pub miner: Arc<TestMinerService>,
Expand Down
9 changes: 3 additions & 6 deletions crates/rpc/src/v1/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub use rpc_common::Bytes;

pub use self::{
account_info::{AccountInfo, EthAccount, ExtAccountInfo, RecoveredAccount, StorageProof},
block::{Block, BlockTransactions, Header, Rich, RichBlock, RichHeader},
block::{Block, BlockTransactions, Header, RichBlock, RichHeader},
block_number::{block_number_to_id, BlockNumber},
call_request::CallRequest,
confirmations::{
Expand All @@ -40,14 +40,11 @@ pub use self::{
receipt::Receipt,
rpc_settings::RpcSettings,
secretstore::EncryptedDocumentKey,
sync::{
ChainStatus, EthProtocolInfo, PeerInfo, PeerNetworkInfo, PeerProtocolsInfo, Peers,
SyncInfo, SyncStatus, TransactionStats,
},
sync::{ChainStatus, Peers, SyncInfo, SyncStatus, TransactionStats},
trace::{LocalizedTrace, TraceResults, TraceResultsWithTransactionHash},
trace_filter::TraceFilter,
transaction::{LocalTransactionStatus, RichRawTransaction, Transaction},
transaction_access_list::{AccessList, AccessListItem},
transaction_access_list::AccessList,
transaction_condition::TransactionCondition,
transaction_request::TransactionRequest,
work::Work,
Expand Down
3 changes: 2 additions & 1 deletion crates/rpc/src/v1/types/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,12 @@ impl LocalTransactionStatus {

#[cfg(test)]
mod tests {
use crate::v1::types::transaction_access_list::AccessListItem;

use super::{LocalTransactionStatus, Transaction};
use ethereum_types::H256;
use serde_json;
use types::transaction::TypedTxId;
use v1::types::AccessListItem;

#[test]
fn test_transaction_serialize() {
Expand Down
Loading