Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

chore: improve users util #813

Merged
merged 6 commits into from
Mar 28, 2023
Merged

chore: improve users util #813

merged 6 commits into from
Mar 28, 2023

Conversation

harrysolovay
Copy link
Contributor

@harrysolovay harrysolovay commented Mar 27, 2023

Fixes #760

Enables one to use createUsers (renamed from users) without specifying a count, which will cause it to default to a record (not a list) of 26 named Sr25519s.

const { alexa, billy, carol, david } = await createUsers()

Count specificity still works as is did before.

const [a, b, c, d] = await createUsers(4)

@harrysolovay
Copy link
Contributor Author

harrysolovay commented Mar 27, 2023

Will this be confusing? / will devs think that accessing a named user from multiple users() calls will yield the same Sr25519? If so, perhaps we should rename the util to nextUsers or something that indicates the creation of a new set.

EDIT

Yea, this was going to be confusing. Hence we've renamed users to createUsers.

crypto/test_pairs.ts Outdated Show resolved Hide resolved
crypto/test_pairs.ts Outdated Show resolved Hide resolved
Co-authored-by: T6 <t6@t6.fyi>
@harrysolovay harrysolovay added this pull request to the merge queue Mar 28, 2023
Merged via the queue into main with commit 8331e02 Mar 28, 2023
@harrysolovay harrysolovay deleted the improve-user-util branch March 28, 2023 14:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

simplify test user util
2 participants