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

Add test showing register and sign with test client #1012

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

ameba23
Copy link
Contributor

@ameba23 ameba23 commented Aug 16, 2024

@HCastano you don't need to merge this, i just wanted to see it passing.

I really wanted to make this an integration test, but it didn't work out. The cool thing about the new registration flow is that we can test it in integration because it doesn't rely on there being multiple chain nodes.

But not quite. We have the pre-existing parent keyshares - but we don't have a way to get the chain to a state where jumpstart is completed. The staking extension pallet's genesis config would need to let us put the chain into a jump start completed state. Something for another PR.

@ameba23 ameba23 requested a review from HCastano August 16, 2024 08:40
@JesseAbram
Copy link
Member

@HCastano you don't need to merge this, i just wanted to see it passing.

I really wanted to make this an integration test, but it didn't work out. The cool thing about the new registration flow is that we can test it in integration because it doesn't rely on there being multiple chain nodes.

But not quite. We have the pre-existing parent keyshares - but we don't have a way to get the chain to a state where jumpstart is completed. The staking extension pallet's genesis config would need to let us put the chain into a jump start completed state. Something for another PR.

ya we do, you do it here https://github.com/entropyxyz/entropy-core/pull/1012/files#diff-e1d8c0027f2fda5b3998b919bb461f5935ad1f6690b719c637968150be6f5e76R1581 this "tricks" the network into that state

@ameba23
Copy link
Contributor Author

ameba23 commented Aug 16, 2024

ya we do, you do it here https://github.com/entropyxyz/entropy-core/pull/1012/files#diff-e1d8c0027f2fda5b3998b919bb461f5935ad1f6690b719c637968150be6f5e76R1581 this "tricks" the network into that state

i thought we probably wouldn't be able to call that function without cfg(test) because it uses test sort of stuff like development_mnemonic. But actually probably we can and that would be an easier way to do it. We could re-export it in testing-utils to save having to make it public without cfg(test).

@HCastano
Copy link
Collaborator

@ameba23 this is pretty cool!

I say it would be worth it to spend a little bit of time trying to turn this into an integration test if possible. If not, maybe a another place for it could be the entropy_client tests?

Base automatically changed from hc/update-test-cli to master August 20, 2024 21:01
@HCastano HCastano force-pushed the peg/tss-integration-test branch from 9d6963f to 490a590 Compare August 20, 2024 21:02
@HCastano
Copy link
Collaborator

@ameba23 I've rebased + force pushed this since #1008 has been merged

pub async fn jump_start_network_with_signer(
api: &OnlineClient<EntropyConfig>,
rpc: &LegacyRpcMethods<EntropyConfig>,
signer: &PairSigner<EntropyConfig, sr25519::Pair>,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was needed because sp_keyring is a development dependency and we now need this fn in release mode if the test_helpers feature is present. So here we pass a signer in instead of getting it from the keyring, and the unit tests use a wrapped version of this function which grabs alice from the keyring.

@ameba23
Copy link
Contributor Author

ameba23 commented Aug 21, 2024

So @JesseAbram you were right the mock jump start will work fine outside of cfg(test).

So i have made this into an integration test.

@ameba23 ameba23 requested a review from JesseAbram August 21, 2024 11:13
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.

👍

@ameba23 ameba23 merged commit e6cd922 into master Aug 22, 2024
8 checks passed
@ameba23 ameba23 deleted the peg/tss-integration-test branch August 22, 2024 06:17
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.

3 participants