Skip to content
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

refactor(rust): refactor to use typed interfaces to implement commands for relays #7204

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

kunio66
Copy link
Contributor

@kunio66 kunio66 commented Dec 21, 2023

Current behavior

Please refer to #6704.

Proposed changes

Implement the list/delete command for relays using typed interface.

Test results

To verify my changes, I tested them with ockam/implementations/rust/ockam/ockam_command/tests/bats/relay.bats. All tests passed.

$ bats relay.bats
relay.bats
 ✓ relay - create relay and send message through it
 ✓ relay - create two relays and list them on a node
 ✓ relay - CRUD

3 tests, 0 failures

Checks

  • All commits in this Pull Request are signed and Verified by Github.
  • All commits in this Pull Request follow the Ockam commit message convention.
  • There are no Merge commits in this Pull Request. Ockam repo maintains a linear commit history. We merge Pull Requests by rebasing them onto the develop branch. Rebasing to the latest develop branch and force pushing to your Pull Request branch is okay.
  • I have read and accept the Ockam Community Code of Conduct.
  • I have read and accepted the Ockam Contributor License Agreement by adding my Git/Github details in a row at the end of the CONTRIBUTORS.csv file in a separate pull request to the build-trust/ockam repository. The easiest way to do this is to edit the CONTRIBUTORS.csv file in the github web UI and create a separate Pull Request, this will mark the commit as verified.

Copy link
Member

@etorreborre etorreborre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kunio66, that looks good. Can you please format the code and adjust your commit messages?

@@ -402,6 +413,14 @@ impl Relays for BackgroundNode {
self.ask(ctx, Request::post("/node/forwarder").body(body))
.await
}

async fn list_relay(&self, ctx: &Context) -> miette::Result<Vec<RelayInfo>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a s here: list_relays

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I forgot to run cargo fmt. I will fix it right away.
Could you be more specific about how to modify the commit message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants