-
Notifications
You must be signed in to change notification settings - Fork 16
warnings as errors #583
warnings as errors #583
Changes from 4 commits
90a034f
79dea7d
7dad571
526fa24
34fa6c3
fb8e23f
18a22a9
edba5ee
201aff5
d453276
b3d38a3
2071cdc
e876929
69aad5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Mac things | ||
.DS_Store | ||
|
||
# Build. | ||
n# Build. | ||
tests/build | ||
target/ | ||
**/*.rs.bk | ||
|
@@ -52,3 +52,7 @@ tests/rpc-tests/ | |
|
||
# Coverage report from Tarpaulin | ||
cobertura.xml | ||
|
||
# in case credentials are put in the repo for using | ||
# inside the docker container | ||
.git-credentials | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Newline. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#![deny(warnings)] | ||
extern crate protobuf; | ||
extern crate serde; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
#[cfg(feature = "test")] | ||
use ekiden_core::random; | ||
use ekiden_keymanager_client::KeyManager as EkidenKeyManager; | ||
use ekiden_keymanager_common::{ContractId, ContractKey}; | ||
use ekiden_keymanager_common::ContractKey; | ||
#[cfg(feature = "test")] | ||
use ekiden_keymanager_common::{ | ||
PublicKeyType, EMPTY_PRIVATE_KEY, EMPTY_PUBLIC_KEY, EMPTY_STATE_KEY, | ||
}; | ||
use ethereum_types::Address; | ||
use keccak_hash::keccak; | ||
#[cfg(feature = "test")] | ||
use std::collections::HashMap; | ||
#[cfg(feature = "test")] | ||
|
@@ -41,56 +39,6 @@ impl KeyManagerClient { | |
} | ||
} | ||
|
||
/// Wrapper around the Ekiden key manager client to provide a more convenient | ||
/// Ethereum address based interface along with runtime-specific utility methods. | ||
struct KeyManager; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What made you delete this? We still need it. :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it was just not being used There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is definitely used. See KeyManagerClient. We do some conditional compilation for testing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The e2e tests will fail if this is deleted. |
||
impl KeyManager { | ||
/// Returns the contract id for the given contract address. The contract_id | ||
/// is used to fetch keys for a contract. | ||
fn contract_id(contract: Address) -> ContractId { | ||
ContractId::from(&keccak(contract.to_vec())[..]) | ||
} | ||
|
||
/// Creates and returns the long term public key for the given contract. | ||
/// If the key already exists, returns the existing key. | ||
/// Returns the tuple (public_key, signature_{KeyManager}(public_key)). | ||
fn create_long_term_public_key(contract: Address) -> Result<(Vec<u8>, Vec<u8>), String> { | ||
let contract_id = Self::contract_id(contract); | ||
let mut km = EkidenKeyManager::instance().expect("Should always have a key manager client"); | ||
|
||
// first create the keys | ||
km.get_or_create_secret_keys(contract_id) | ||
.map_err(|err| err.description().to_string())?; | ||
// then extract the long term key | ||
km.long_term_public_key(contract_id) | ||
.map_err(|err| err.description().to_string()) | ||
.map(|pk_payload| { | ||
( | ||
pk_payload.public_key.to_vec(), | ||
pk_payload.signature.to_vec(), | ||
) | ||
}) | ||
} | ||
|
||
fn contract_key(address: Address) -> Result<ContractKey, String> { | ||
let contract_id = Self::contract_id(address); | ||
let mut km = EkidenKeyManager::instance().expect("Should always have a key manager client"); | ||
|
||
let (secret_key, state_key) = km | ||
.get_or_create_secret_keys(contract_id) | ||
.map_err(|err| err.description().to_string())?; | ||
let public_key_payload = km | ||
.get_public_key(contract_id) | ||
.map_err(|err| err.description().to_string())?; | ||
|
||
Ok(ContractKey::new( | ||
public_key_payload.public_key, | ||
secret_key, | ||
state_key, | ||
)) | ||
} | ||
} | ||
|
||
#[cfg(feature = "test")] | ||
lazy_static! { | ||
static ref TEST_KEY_MANAGER: Mutex<TestKeyManager> = Mutex::new(TestKeyManager::new()); | ||
|
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; | ||
|
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; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you added this by accident.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, let me fix it