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

Make common crate for TSS and test client #775

Merged
merged 31 commits into from
May 2, 2024
Merged

Conversation

ameba23
Copy link
Contributor

@ameba23 ameba23 commented Apr 23, 2024

In order to use the entropy test client in entropy_testing_utils::test_client we need to have entropy_tss as a dependency. This means we cant make a simple client without having all the dependencies from entropy-tss.

For example the testnet status page depends on it, as does the CLI for storing programs - for more context see the discussion in the PR for that: entropyxyz/programs#68 (comment)

This PR adds a new crate entropy-client which includes the bits a client needs from entropy-tss, as well as the contents of entropy_testing_utils::test_client. entropy-cilent contains for example the chain metadata and the UserSignatureRequest struct.

Since entropty-tss does not need everything in entropy-client, there is a 'full-client' feature (enabled by default) which adds the bits entropy-tss does not depend on.

To do in followups:

  • The entropy-tss integration tests now don't need anything from entropy-tss. This means entropy-tss now no longer needs to be a library crate. The advantage of turning it back into just a binary crate is that we get the full API documented - not just the bits we expose as library functions.
  • Ideally, everything in entropy-client should compile to wasm. Currently it does compile with --no-default-features -F wasm. But we cannot submit extrinsics because of needing subxt::tx::PairSigner. There is for sure a way round this. Also we need to access the system clock for adding timestamps to signature requests - we just need to use js_sys::Date instead of std::time::SystemTime.
  • Make error types rather than using anyhow for the client.

@ameba23 ameba23 marked this pull request as draft April 23, 2024 08:11
@ameba23 ameba23 changed the title Make common crates for tss and test client Make common crate for tss and test client Apr 26, 2024
@ameba23 ameba23 changed the title Make common crate for tss and test client Make common crate for TSS and test client Apr 26, 2024
@ameba23 ameba23 marked this pull request as ready for review April 26, 2024 12:09
@ameba23 ameba23 requested a review from JesseAbram April 26, 2024 12:09
Copy link
Member

@JesseAbram JesseAbram left a comment

Choose a reason for hiding this comment

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

looks good maybe should in the future also consider common packages being being in the workspace cargo.toml

@@ -0,0 +1,57 @@
[package]
name ="entropy-client"
version ="0.0.1"
Copy link
Member

Choose a reason for hiding this comment

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

probably should fast forward to same version as other packages?

@ameba23 ameba23 merged commit 91b241d into master May 2, 2024
11 checks passed
@ameba23 ameba23 deleted the peg/tss-client-common branch May 2, 2024 06:55
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