Conversation
Signed-off-by: Sam Batschelet <sam.batschelet@avalabs.org>
Signed-off-by: Sam Batschelet <sam.batschelet@avalabs.org>
Signed-off-by: Sam Batschelet <sam.batschelet@avalabs.org>
Signed-off-by: Sam Batschelet <sam.batschelet@avalabs.org>
Signed-off-by: Sam Batschelet <sam.batschelet@avalabs.org>
hexfusion
commented
Nov 23, 2022
| assert!(resp.is_ok()); | ||
| let resp = resp.unwrap(); | ||
| let body = std::str::from_utf8(&resp.body()).unwrap(); | ||
| log::info!("ping response {}", body); |
Contributor
Author
There was a problem hiding this comment.
thee are very verbose eventually we can add more helpers.
hexfusion
commented
Nov 23, 2022
| env_logger = "0.9.3" | ||
| hex = "0.4.3" | ||
| http = "0.2.8" | ||
| hyper = "0.14.23" |
Contributor
Author
There was a problem hiding this comment.
I think we can create a new feature client and make stuff like hyper optional.
exdx
approved these changes
Nov 23, 2022
Contributor
exdx
left a comment
There was a problem hiding this comment.
This looks great! Just some feedback.
| } | ||
|
|
||
| #[tokio::main] | ||
| async fn main() -> Result<(), Box<dyn error::Error>> { |
Contributor
There was a problem hiding this comment.
Another option is to use the anyhow::Result<> type as the response type. I especially like it for CLI tools. We don't have to end up with a type erased box in the signature.
For an example, see https://github.com/exdx/dcp/blob/main/src/main.rs
We could tackle this as a follow-up though.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR moves the core logic out of
spaces-cliand adds it to the api module. This allows for custom implementations of the client and simplifies testing. The new api client includes methods which make it easier to debug RPC calls by having direct access to the request object.In addition this PR will add integration tests which perform round trip requests to the API to reduce time required to debug e2e tests.
This work is needed for #85
Signed-off-by: Sam Batschelet sam.batschelet@avalabs.org