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

Commit

Permalink
Merge pull request #143 from enigmampc/nonexsitent_fix
Browse files Browse the repository at this point in the history
BUG: change error print from debug to display which will show only th…
  • Loading branch information
AvishaiW authored May 6, 2019
2 parents c1555a9 + 13c9289 commit 33dfec3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions enigma-core/app/src/networking/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ pub(crate) trait UnwrapError<T> {
fn unwrap_or_error(self) -> T;
}

impl<E: std::fmt::Debug> UnwrapError<IpcResponse> for Result<IpcResponse, E> {
impl<E: std::fmt::Display> UnwrapError<IpcResponse> for Result<IpcResponse, E> {
fn unwrap_or_error(self) -> IpcResponse {
match self {
Ok(m) => m,
Err(e) => {
error!("Unwrapped p2p Message failed: {:?}", e);
IpcResponse::Error {msg: format!("{:?}", e)}
error!("Unwrapped p2p Message failed: {}", e);
IpcResponse::Error {msg: format!("{}", e)}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions enigma-core/app/tests/ipc_identity_and_general_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn test_deploy_with_no_ptt() {
run_core(port);
let _val = erc20_deployment_without_ptt_to_addr(port, &generate_contract_address().to_hex());
let accepted_err = _val["msg"].as_str().unwrap();
assert_eq!(accepted_err, "EnclaveFailError { err: KeysError, status: SGX_SUCCESS }");
assert_eq!(accepted_err, "Error inside the Enclave = (KeysError)");
}

#[test]
Expand All @@ -53,7 +53,7 @@ fn test_compute_on_empty_address() {
let callable = "mint(bytes32,uint256)";
let (_val,_) = contract_compute(port, _address.into(), &args, callable);
let accepted_err = _val["msg"].as_str().unwrap();
assert_eq!(accepted_err, "DBErr { command: \"read\", kind: MissingKey }");
assert_eq!(accepted_err, "Error while trying to read, Because: The Key doesn\'t exist");
}

#[test]
Expand Down Expand Up @@ -96,7 +96,7 @@ fn test_deploy_same_contract_twice() {
let _deploy_first = erc20_deployment_without_ptt_to_addr(port, &address.to_hex());
let _deploy_second = erc20_deployment_without_ptt_to_addr(port, &address.to_hex());
let accepted_err = _deploy_second["msg"].as_str().unwrap();
assert_eq!(accepted_err, "DBErr { command: \"create\", kind: KeyExists }");
assert_eq!(accepted_err, "Error while trying to create, Because: The Key already exists");
}

#[test]
Expand Down

0 comments on commit 33dfec3

Please sign in to comment.