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

Test CLI command to retrieve quote and change endpoint / TSS account in one command #1198

Merged
merged 14 commits into from
Dec 11, 2024

Conversation

ameba23
Copy link
Contributor

@ameba23 ameba23 commented Dec 4, 2024

I am using the change_endpoint extrinsic to test attestation (by changing the endpoint to the same as what it was before, just to check the quote can be validated).

The test-cli has a command to retrieve a quote and write it to a file, and and another command to change the endpoint with a quote given as a string. Its currently a bit tricky to convert the quote file to a string as its binary not utf8. Since these two things generally need to be done one after the other, this PR makes a single command which gets the quote and uses it in the change_endpoint or change_threshold_accounts extrinsic.

This PR also has some stuff tacked on which should really be in separate PRs:

  • I have also made some minor changes to the error handling / arguments of the change_endpoint / change_threshold_accounts client functions.
  • A little refactor of how we handle mnemonics in the test-cli.
  • A fix for the get-tdx-quote command to make it also take the context in which the quote will be used.

@ameba23 ameba23 marked this pull request as draft December 4, 2024 15:23
@ameba23 ameba23 self-assigned this Dec 4, 2024
@ameba23 ameba23 added this to the v0.4.0 milestone Dec 4, 2024
Ok(<sr25519::Pair as Pair>::from_string(&mnemonic, None)?)
}

/// This is the same as [QuoteContext] but implements [ValueEnum]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its annoying to have to do this but implementing clap::ValueEnum for QuoteContext would mean having clap as a dependency of entropy-shared.

@ameba23 ameba23 marked this pull request as ready for review December 9, 2024 11:29
* master:
  Bump thiserror from 2.0.4 to 2.0.6 in the patch-dependencies group (#1206)
  Downgrade parity-scale-codec as version we currently use has been yanked (#1205)
  Bump clap from 4.5.22 to 4.5.23 in the patch-dependencies group (#1202)
  Add oracle data pointer check (#1194)
  Bump tokio from 1.41.1 to 1.42.0 (#1196)
  Allow offchain worker requests to all TSS nodes in `entropy-tss` test environment  (#1147)
  Bump the patch-dependencies group with 3 updates (#1195)
@ameba23 ameba23 merged commit 6d3351e into master Dec 11, 2024
8 checks passed
@ameba23 ameba23 deleted the peg/quote-and-change-endpoint branch December 11, 2024 07:43
ameba23 added a commit that referenced this pull request Dec 13, 2024
* master:
  Add TDX test network chainspec (#1204)
  Test CLI command to retrieve quote and change endpoint / TSS account in one command (#1198)
  Bump the patch-dependencies group with 2 updates (#1212)
  Bump thiserror from 2.0.4 to 2.0.6 in the patch-dependencies group (#1206)
  Downgrade parity-scale-codec as version we currently use has been yanked (#1205)
  Bump clap from 4.5.22 to 4.5.23 in the patch-dependencies group (#1202)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants