Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/nodejs
Browse files Browse the repository at this point in the history
  • Loading branch information
jovfer authored Mar 13, 2019
2 parents 503becb + ae74c1b commit 78eb16a
Show file tree
Hide file tree
Showing 86 changed files with 3,620 additions and 4,133 deletions.
2 changes: 1 addition & 1 deletion vcx/dummy-cloud-agent/src/actors/agent_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1614,4 +1614,4 @@ mod tests {
})
});
}
}
}
1 change: 0 additions & 1 deletion vcx/dummy-cloud-agent/src/domain/a2a.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1291,4 +1291,3 @@ struct UnpackMessage {
message: String,
sender_verkey: Option<String>
}

5 changes: 1 addition & 4 deletions vcx/dummy-cloud-agent/src/domain/internal_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,4 @@ impl InternalMessage {
thread,
}
}
}



}
2 changes: 1 addition & 1 deletion vcx/dummy-cloud-agent/src/domain/invite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ pub struct AgentDetail {
pub did: String,
// Agent Verkey
pub verkey: String,
}
}
50 changes: 25 additions & 25 deletions vcx/dummy-cloud-agent/src/utils/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ pub fn compose_connect(wallet_handle: i32) -> BoxedFuture<Vec<u8>, Error> {
}))];

let msg = A2AMessage::prepare_authcrypted(wallet_handle,
EDGE_AGENT_DID_VERKEY,
FORWARD_AGENT_DID_VERKEY,
&msgs).wait().unwrap();
EDGE_AGENT_DID_VERKEY,
FORWARD_AGENT_DID_VERKEY,
&msgs).wait().unwrap();
compose_forward(wallet_handle, FORWARD_AGENT_DID, FORWARD_AGENT_DID_VERKEY, msg)
}

Expand All @@ -260,9 +260,9 @@ pub fn compose_signup(wallet_handle: i32, pairwise_did: &str, pairwise_verkey: &
let msgs = [A2AMessage::Version1(A2AMessageV1::SignUp(SignUp {}))];

let msg = A2AMessage::prepare_authcrypted(wallet_handle,
EDGE_AGENT_DID_VERKEY,
pairwise_verkey,
&msgs).wait().unwrap();
EDGE_AGENT_DID_VERKEY,
pairwise_verkey,
&msgs).wait().unwrap();
compose_forward(wallet_handle,&pairwise_did, FORWARD_AGENT_DID_VERKEY, msg)
}

Expand All @@ -282,9 +282,9 @@ pub fn compose_create_agent(wallet_handle: i32, pairwise_did: &str, pairwise_ver
let msgs = vec![A2AMessage::Version1(A2AMessageV1::CreateAgent(CreateAgent {}))];

let msg = A2AMessage::prepare_authcrypted(wallet_handle,
EDGE_AGENT_DID_VERKEY,
pairwise_verkey,
&msgs).wait().unwrap();
EDGE_AGENT_DID_VERKEY,
pairwise_verkey,
&msgs).wait().unwrap();
compose_forward(wallet_handle,pairwise_did, FORWARD_AGENT_DID_VERKEY, msg)
}

Expand All @@ -309,9 +309,9 @@ pub fn compose_create_key(wallet_handle: i32, agent_did: &str, agent_verkey: &st
}))];

let msg = A2AMessage::prepare_authcrypted(wallet_handle,
EDGE_AGENT_DID_VERKEY,
agent_verkey,
&msgs).wait().unwrap();
EDGE_AGENT_DID_VERKEY,
agent_verkey,
&msgs).wait().unwrap();
compose_forward(wallet_handle,agent_did, FORWARD_AGENT_DID_VERKEY, msg)
}

Expand Down Expand Up @@ -355,7 +355,7 @@ pub fn decompose_connection_request_created(wallet_handle: i32, msg: &[u8]) -> B
assert_eq!(2, msgs.len());
match (msgs.remove(0), msgs.remove(0)) {
(A2AMessage::Version1(A2AMessageV1::MessageCreated(msg_created)),
A2AMessage::Version1(A2AMessageV1::MessageDetail(MessageDetail::ConnectionRequestResp(msg_details)))) =>
A2AMessage::Version1(A2AMessageV1::MessageDetail(MessageDetail::ConnectionRequestResp(msg_details)))) =>
Ok((sender_verkey, msg_created.uid, msg_details.invite_detail)),
_ => Err(err_msg("Invalid message"))
}
Expand Down Expand Up @@ -546,9 +546,9 @@ pub fn compose_get_messages_by_connection(wallet_handle: i32,
pairwise_dids: Vec::new(),
}))];
let msg = A2AMessage::prepare_authcrypted(wallet_handle,
EDGE_AGENT_DID_VERKEY,
agent_verkey,
&msgs).wait().unwrap();
EDGE_AGENT_DID_VERKEY,
agent_verkey,
&msgs).wait().unwrap();
compose_forward(wallet_handle,agent_did, FORWARD_AGENT_DID_VERKEY, msg)
}
pub fn decompose_get_messages_by_connection(wallet_handle: i32, msg: &[u8]) -> BoxedFuture<(String, Vec<MessagesByConnection>), Error> {
Expand All @@ -574,9 +574,9 @@ pub fn compose_update_configs(wallet_handle: i32, agent_did: &str, agent_verkey:
}))];

let msg = A2AMessage::prepare_authcrypted(wallet_handle,
EDGE_AGENT_DID_VERKEY,
agent_verkey,
&msgs).wait().unwrap();
EDGE_AGENT_DID_VERKEY,
agent_verkey,
&msgs).wait().unwrap();

compose_forward(wallet_handle, agent_did, FORWARD_AGENT_DID_VERKEY, msg)
}
Expand All @@ -588,9 +588,9 @@ pub fn compose_get_configs(wallet_handle: i32, agent_did: &str, agent_verkey: &s
}))];

let msg = A2AMessage::prepare_authcrypted(wallet_handle,
EDGE_AGENT_DID_VERKEY,
agent_verkey,
&msgs).wait().unwrap();
EDGE_AGENT_DID_VERKEY,
agent_verkey,
&msgs).wait().unwrap();

compose_forward(wallet_handle, agent_did, FORWARD_AGENT_DID_VERKEY, msg)
}
Expand All @@ -614,9 +614,9 @@ pub fn compose_remove_configs(wallet_handle: i32, agent_did: &str, agent_verkey:
}))];

let msg = A2AMessage::prepare_authcrypted(wallet_handle,
EDGE_AGENT_DID_VERKEY,
agent_verkey,
&msgs).wait().unwrap();
EDGE_AGENT_DID_VERKEY,
agent_verkey,
&msgs).wait().unwrap();

compose_forward(wallet_handle, agent_did, FORWARD_AGENT_DID_VERKEY, msg)
}
Expand Down
1 change: 1 addition & 0 deletions vcx/libvcx/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vcx/libvcx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ tokio-threadpool = "0.1.6"
futures = "0.1.23"
libloading = "0.5.0"
uuid = {version = "0.7.1", default-features = false, features = ["v4"]}
failure = "0.1.3"

[target.'cfg(target_os = "android")'.dependencies]
android_logger = "0.5"
Expand Down
20 changes: 20 additions & 0 deletions vcx/libvcx/include/vcx.h
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,26 @@ vcx_error_t vcx_get_logger(const void* vcx_get_logger,
vcx_u32_t line),
void (**flushFn)(const void* context) );

/// Get details for last occurred error.
///
/// This function should be called in two places to handle both cases of error occurrence:
/// 1) synchronous - in the same application thread
/// 2) asynchronous - inside of function callback
///
/// NOTE: Error is stored until the next one occurs in the same execution thread or until asynchronous callback finished.
/// Returning pointer has the same lifetime.
///
/// #Params
/// * `error_json_p` - Reference that will contain error details (if any error has occurred before)
/// in the format:
/// {
/// "backtrace": Optional<str> - error backtrace.
/// Collecting of backtrace can be enabled by setting environment variable `RUST_BACKTRACE=1`
/// "message": str - human-readable error description
/// }
///
vcx_error_t vcx_get_current_error(const char ** error_json_p);

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down
Loading

0 comments on commit 78eb16a

Please sign in to comment.