-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Root event date #125
Root event date #125
Conversation
trustchain-cli/src/bin/main.rs
Outdated
// Can unwrap as already verified above. | ||
.unwrap(); | ||
let chain = | ||
TrustchainAPI::verify(issuer, root_event_time.into(), &verifier) |
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.
Remove into()
(clippy)
trustchain-core/src/utils.rs
Outdated
let mut did = String::from_str("did:").unwrap(); | ||
did.push_str(method); | ||
did.push_str(":"); | ||
did.push_str(did_suffix); | ||
did |
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.
let mut did = String::from_str("did:").unwrap(); | |
did.push_str(method); | |
did.push_str(":"); | |
did.push_str(did_suffix); | |
did | |
format!("did:{method}:{did_suffix}") |
trustchain-http/src/errors.rs
Outdated
@@ -108,6 +118,7 @@ impl IntoResponse for TrustchainHTTPError { | |||
err @ TrustchainHTTPError::NoCredentialIssuer => { | |||
(StatusCode::BAD_REQUEST, err.to_string()) | |||
} | |||
err @ TrustchainHTTPError::RootError(_) => (StatusCode::BAD_REQUEST, err.to_string()), |
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.
Check the HTTP status
trustchain-http/src/root.rs
Outdated
debug!("Getting root candidates for {0}", date); | ||
|
||
// Return the cached vector of root DID candidates, if available. | ||
if root_candidates.lock().unwrap().contains_key(&date) { |
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.
Perhaps create a single lock to use throughout function?
trustchain-ion/src/verifier.rs
Outdated
@@ -134,20 +131,20 @@ where | |||
|
|||
/// Gets RPC client. | |||
fn rpc_client(&self) -> &bitcoincore_rpc::Client { | |||
self.rpc_client.as_ref().unwrap() | |||
self.rpc_client.as_ref().unwrap() // TODO: handle failure here. |
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 this is ok as the API has constrained it to exist here
trustchain-ion/src/verifier.rs
Outdated
} | ||
|
||
/// Gets IPFS client. | ||
fn ipfs_client(&self) -> &IpfsClient { | ||
self.ipfs_client.as_ref().unwrap() | ||
self.ipfs_client.as_ref().unwrap() // TODO: handle failure here. |
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.
As above on 134
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.
looks good!
Server-side code to support trustchain-mobile #26.
Adds an HTTP endpoint for getting candidate root DIDs (each with a corresponding Bitcoin transaction ID) that were timestamped on a given a calendar date.
Does not address the related #130.