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

Include simple CLI with testing-utils #417

Merged
merged 84 commits into from
Dec 1, 2023
Merged

Include simple CLI with testing-utils #417

merged 84 commits into from
Dec 1, 2023

Conversation

ameba23
Copy link
Contributor

@ameba23 ameba23 commented Oct 5, 2023

This adds a simple client to the testing-utils crate, which allows us to register, update a program, and sign a message, and an integration test which uses it.

The idea is to have a simple client which is tested as part of CI. So when making a deployment you can check things are working with a client which is likely to work as long as CI passes.

For the CLI, there is no private key storage, rather you give an 'account name' used as a seed string, so if you give the name 'foo' you get the same keypair that subkey inspect //foo would give you.

Unfortunately, its not currently possible to test registering. Since our testing setup only has one chain node running, only one of the TSS server gets info from the propagation pallet. In unit tests we 'simulate' the second chain node making requests to the second TSS server, but thats harder to do in an integration test. I am gonna make an issue for this, but for now i've tested registering manually using the CLI with both the AWS devnet and locally with docker compose.

@vercel
Copy link

vercel bot commented Oct 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
entropy-core ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 1, 2023 9:14am

@ameba23 ameba23 marked this pull request as draft October 5, 2023 22:17
ameba23 and others added 10 commits November 30, 2023 10:15
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
…o subxt-client

* 'subxt-client' of github.com:entropyxyz/entropy-core:
  Initialize test logger in integration test
  Initialise test logger in integration test
@ameba23
Copy link
Contributor Author

ameba23 commented Nov 30, 2023

@HCastano i think i have made all the changes you suggested.

I played around with it locally but wasn't able to do everything. It would be nice to have some usage examples provided. We could either have this as part of the CLI docs or possibly in a standalone README file.

I've added a readme with as many gotchas as i can think of. If it still doesn't seem to work, please let me know.

Copy link
Collaborator

@HCastano HCastano left a comment

Choose a reason for hiding this comment

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

Cool, LGTM!

crypto/test-cli/Cargo.toml Outdated Show resolved Hide resolved
crypto/test-cli/Cargo.toml Outdated Show resolved Hide resolved
crypto/test-cli/README.md Outdated Show resolved Hide resolved
crypto/test-cli/README.md Outdated Show resolved Hide resolved
crypto/test-cli/README.md Show resolved Hide resolved
Comment on lines +23 to +24
async fn integration_test_sign() {
clean_tests();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm fair enough. Alright let's leave the logging out for now then and maybe follow up with it in another PR/issue

ameba23 and others added 5 commits December 1, 2023 09:22
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
* master:
  Release `v0.0.9` (#538)
  Export plain binaries, always `strip(1)`, use `cargo build`. (#534)
  Add Loki logging layer (#528)
@ameba23 ameba23 merged commit 84eb9e3 into master Dec 1, 2023
5 checks passed
@ameba23 ameba23 deleted the subxt-client branch December 1, 2023 10:20
@@ -9,6 +9,8 @@ At the moment this project **does not** adhere to

## [Unreleased]

- Test CLI which calls the same code as in integration tests ([#417](https://github.com/entropyxyz/entropy-core/pull/417))
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ameba23 the CHANGELOG entry should match the PR title. We also need to put this under a header, e.g Added, Changed, etc.

Thanks for remembering to add an entry to the CHANGELOG though 😄

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