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

Refactoring ts integration tests to get worker url from the parachain #3041

Merged
merged 4 commits into from
Sep 4, 2024

Conversation

silva-fj
Copy link
Contributor

@silva-fj silva-fj commented Sep 3, 2024

The key changes in this PR are:

  • We no longer use a hardcoded worker url, instead we get the url from the registered enclaves in the parachain.
  • We select a random enclave from the registry.

More context in the linear issue

Copy link

linear bot commented Sep 3, 2024

Copy link
Contributor

@jonalvarezz jonalvarezz left a comment

Choose a reason for hiding this comment

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

lgtm

throw new Error('No identity worker found');
}

return identityEnclaves[Math.floor(Math.random() * identityEnclaves.length)].url.toHuman() as string;
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe the .toString() saves from forcing the type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it needs to be casted as well because doing toString() to AnyJson returns string | undefined

@silva-fj silva-fj enabled auto-merge (squash) September 4, 2024 08:02
@silva-fj silva-fj merged commit 1fb33f9 into dev Sep 4, 2024
34 checks passed
@silva-fj silva-fj deleted the p-335-use-all-available-workers-in-ts-tests branch September 4, 2024 08:28
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