Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

Commit

Permalink
warnings as errors
Browse files Browse the repository at this point in the history
  • Loading branch information
eauge committed Feb 14, 2019
1 parent 4d91b45 commit 90a034f
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 48 deletions.
1 change: 1 addition & 0 deletions api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![deny(warnings)]
extern crate protobuf;
extern crate serde;

Expand Down
1 change: 1 addition & 0 deletions common/src/confidential/confidential_ctx.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![deny(warnings)]
use super::key_manager::KeyManagerClient;
use ekiden_core::mrae::{
nonce::{Nonce, NONCE_SIZE},
Expand Down
1 change: 1 addition & 0 deletions common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Common data structures shared by runtime and gateway.
#![deny(warnings)]
extern crate ekiden_core;
extern crate ekiden_keymanager_client;
extern crate ekiden_keymanager_common;
Expand Down
1 change: 1 addition & 0 deletions gateway/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

//! web3 gateway for Oasis Ethereum runtime.
#![deny(warnings)]
extern crate ctrlc;
extern crate fdlimit;
extern crate log;
Expand Down
9 changes: 3 additions & 6 deletions gateway/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ use hash::keccak;
use parity_rpc::v1::types::Bytes as RpcBytes;
use runtime_ethereum;
use runtime_ethereum_common::{confidential::has_confidential_prefix, State as EthState};
use std::time::{SystemTime, UNIX_EPOCH};
use traits::confidential::PublicKeyResult;
use transaction::{Action, LocalizedTransaction, SignedTransaction};

use client_utils::{self, db::Snapshot};
use ekiden_common::{bytes::B512, environment::Environment};
use ekiden_common::{environment::Environment};
use ekiden_core::{error::Error, futures::prelude::*};
use ekiden_db_trusted::Database;
use ekiden_keymanager_client::KeyManager as EkidenKeyManager;
Expand Down Expand Up @@ -817,9 +816,9 @@ impl Client {
.is_confidential(transaction)
.map_err(|_| CallError::StateCorrupt)?
{
self.confidential_estimate_gas(transaction, id)
self.confidential_estimate_gas(transaction)
} else {
self._estimate_gas(transaction, id, db, state)
self._estimate_gas(transaction, db, state)
}
}

Expand All @@ -828,7 +827,6 @@ impl Client {
fn _estimate_gas<T: 'static + Database + Send + Sync>(
&self,
transaction: &SignedTransaction,
id: BlockId,
db: StateDb<T>,
mut state: EthState,
) -> Result<U256, CallError> {
Expand All @@ -849,7 +847,6 @@ impl Client {
fn confidential_estimate_gas(
&self,
transaction: &SignedTransaction,
id: BlockId,
) -> Result<U256, CallError> {
info!("estimating gas for a confidential contract");

Expand Down
12 changes: 3 additions & 9 deletions gateway/src/impls/confidential.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
use client::Client;
use ekiden_common::bytes::B512;
use ekiden_core::futures::FutureExt;
use ekiden_keymanager_common::confidential;
use ethereum_api::TransactionRequest;
use ethereum_types::Address;
use impls::eth::EthClient;
use jsonrpc_core::{
futures::{future, Future},
futures::{Future},
BoxFuture, Error, ErrorCode, Result,
};
use jsonrpc_macros::Trailing;
use parity_rpc::v1::{
helpers::errors,
metadata::Metadata,
traits::Eth,
types::{BlockNumber, Bytes, CallRequest, H256},
types::{BlockNumber, Bytes, CallRequest},
};
use std::sync::Arc;
use traits::confidential::{Confidential, PublicKeyResult};

pub struct ConfidentialClient {
client: Arc<Client>,
eth_client: EthClient,
}

impl ConfidentialClient {
pub fn new(client: Arc<Client>) -> Self {
ConfidentialClient {
client: client.clone(),
eth_client: EthClient::new(&client),
}
}
}
Expand All @@ -45,7 +39,7 @@ impl Confidential for ConfidentialClient {

fn call_enc(
&self,
meta: Self::Metadata,
_meta: Self::Metadata,
request: CallRequest,
tag: Trailing<BlockNumber>,
) -> BoxFuture<Bytes> {
Expand Down
7 changes: 3 additions & 4 deletions gateway/src/impls/oasis.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use std::{str::FromStr, sync::Arc};
use std::{sync::Arc};

use ekiden_common::bytes::H256;
use ekiden_core::futures::Future;

use ethereum_types::Address;
use jsonrpc_core::{futures::future, BoxFuture, Error, ErrorCode, Result};
use jsonrpc_core::{BoxFuture, Error, ErrorCode};
use jsonrpc_macros::Trailing;
use parity_rpc::v1::types::{BlockNumber, H160 as RpcH160, H256 as RpcH256};
use parity_rpc::v1::types::{BlockNumber, H160 as RpcH160};

use client::Client;
use impls::eth::EthClient;
Expand Down
13 changes: 0 additions & 13 deletions gateway/src/informant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,6 @@ impl RpcStats {
.unwrap_or(0)
}

/// Returns number of open sessions
pub fn sessions(&self) -> usize {
self.sessions.read().len()
}

/// Returns requests rate
pub fn requests_rate(&self, id: &H256) -> usize {
self.sessions
.read()
.get(id)
.map(|calc| calc.read().rate())
.unwrap_or(0)
}
}

#[cfg(test)]
Expand Down
5 changes: 2 additions & 3 deletions gateway/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

//! Ethcore client application.
#![deny(warnings)]

#[macro_use]
extern crate clap;
extern crate env_logger;
#[macro_use]
extern crate futures;
#[macro_use]
extern crate lazy_static;
Expand All @@ -45,7 +45,6 @@ extern crate jsonrpc_pubsub;
extern crate jsonrpc_ws_server;

extern crate common_types;
#[macro_use]
extern crate ethcore;
extern crate ethcore_bytes as bytes;
extern crate ethcore_transaction as transaction;
Expand Down Expand Up @@ -119,7 +118,7 @@ use ethereum_types::U256;

use ekiden_core::{environment::Environment, x509};
use ekiden_runtime_client::create_runtime_client;
use ekiden_storage_base::{BackendIdentityMapper, StorageBackend};
use ekiden_storage_base::{BackendIdentityMapper};
use ethereum_api::with_api;

pub use self::run::RunningClient;
Expand Down
6 changes: 0 additions & 6 deletions gateway/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ pub struct HttpConfiguration {
pub max_batch_size: usize,
}

impl HttpConfiguration {
pub fn address(&self) -> Option<rpc::Host> {
address(self.enabled, &self.interface, self.port, &self.hosts)
}
}

impl Default for HttpConfiguration {
fn default() -> Self {
HttpConfiguration {
Expand Down
3 changes: 0 additions & 3 deletions gateway/src/rpc_apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ impl FromStr for Api {

#[derive(Debug, Clone)]
pub enum ApiSet {
// Safe context (like token-protected WS interface)
SafeContext,
// Unsafe context (like jsonrpc over http)
UnsafeContext,
// All possible APIs
Expand Down Expand Up @@ -239,7 +237,6 @@ impl ApiSet {
match *self {
ApiSet::List(ref apis) => apis.clone(),
ApiSet::UnsafeContext => public_list,
ApiSet::SafeContext => public_list,
ApiSet::All => public_list,
}
}
Expand Down
3 changes: 1 addition & 2 deletions gateway/src/traits/confidential.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use ekiden_common::bytes::B512;
use ethereum_types::Address;
use jsonrpc_core::{BoxFuture, Result};
use jsonrpc_macros::Trailing;
use parity_rpc::v1::types::{BlockNumber, Bytes, CallRequest, H256};
use parity_rpc::v1::types::{BlockNumber, Bytes, CallRequest};

build_rpc_trait! {
pub trait Confidential {
Expand Down
4 changes: 2 additions & 2 deletions gateway/src/traits/oasis.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Oasis rpc interface.
use jsonrpc_core::{BoxFuture, Result};
use jsonrpc_core::{BoxFuture};
use jsonrpc_macros::Trailing;

use parity_rpc::v1::types::{BlockNumber, H160, H256};
use parity_rpc::v1::types::{BlockNumber, H160};

build_rpc_trait! {
pub trait Oasis {
Expand Down
1 change: 1 addition & 0 deletions genesis/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![deny(warnings)]
extern crate clap;
extern crate ethcore;
extern crate ethereum_types;
Expand Down
1 change: 1 addition & 0 deletions inspector/parity_patricia_trie/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

//! Trie interface and implementation.
// extern crate rand;
#![deny(warnings)]
extern crate elastic_array;
extern crate ethcore_bytes as bytes;
extern crate ethereum_types;
Expand Down
1 change: 1 addition & 0 deletions inspector/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![deny(warnings)]
extern crate clap;
extern crate ethcore;
extern crate ethereum_types;
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![deny(warnings)]
extern crate common_types as ethcore_types;
extern crate ekiden_common;
extern crate ekiden_core;
Expand Down

0 comments on commit 90a034f

Please sign in to comment.