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

BUG: change error print from debug to display which will show only th… #143

Merged
merged 1 commit into from
May 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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