Skip to content

Commit

Permalink
[OTE-738] update name generation with manual list (#2161)
Browse files Browse the repository at this point in the history
  • Loading branch information
affanv14 authored Sep 5, 2024
1 parent 42a9b07 commit 190cb44
Show file tree
Hide file tree
Showing 8 changed files with 632 additions and 11 deletions.
6 changes: 0 additions & 6 deletions indexer/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { generateUsername } from '../../src/helpers/usernames-helper';

describe('usernames-helper', () => {
it('Check format of username', () => {
const username: string = generateUsername();
expect(username.match(/[A-Z]/g)).toHaveLength(2);
expect(username.match(/\d/g)).toHaveLength(3);
// check length is at the very minimum 7
expect(username.length).toBeGreaterThanOrEqual(7);
});
});
1 change: 0 additions & 1 deletion indexer/services/roundtable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"lodash": "^4.17.21",
"luxon": "^3.0.1",
"redis": "2.8.0",
"unique-username-generator": "^1.3.0",
"uuid": "^8.3.2"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions indexer/services/roundtable/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export const configSchema = {

// Subaccount username generator
SUBACCOUNT_USERNAME_NUM_RANDOM_DIGITS: parseInteger({ default: 3 }),
SUBACCOUNT_USERNAME_MAX_LENGTH: parseInteger({ default: 13 }),
};

export default parseSchema(configSchema);
Loading

0 comments on commit 190cb44

Please sign in to comment.