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

[DO NOT MERGE] Test indexer change #2576

Draft
wants to merge 2 commits into
base: release/indexer/v7.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/indexer-build-and-push-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: # yamllint disable-line rule:truthy
push:
branches:
- main
- 'td/*'
- 'release/indexer/v[0-9]+.[0-9]+.x' # e.g. release/indexer/v0.1.x
- 'release/indexer/v[0-9]+.x' # e.g. release/indexer/v1.x
# TODO(DEC-837): Customize github build and push to ECR by service with paths
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/indexer-build-and-push-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: # yamllint disable-line rule:truthy
push:
branches:
- main
- 'td/*'
- 'release/indexer/v[0-9]+.[0-9]+.x' # e.g. release/indexer/v0.1.x
- 'release/indexer/v[0-9]+.x' # e.g. release/indexer/v1.x
# TODO(DEC-837): Customize github build and push to ECR by service with paths
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ describe('usernames-helper', () => {
'dydx1df84hz7y0dd3mrqcv3vrhw9wdttelul8edqmvp',
'dydx16h7p7f4dysrgtzptxx2gtpt5d8t834g9dj830z',
'dydx15u9tppy5e2pdndvlrvafxqhuurj9mnpdstzj6z',
'dydx1q54yvrslnu0xp4drpde6f4e0k2ap9efss5hpsd',
'dydx199tqg4wdlnu4qjlxchpd7seg454937hjrknju4',
'dydx1n88uc38xhjgxzw9nwre4ep2c8ga4fjxc565lnf',
'dydx1n88uc38xhjgxzw9nwre4ep2c8ga4fjxc575lnf',
];

const expectedUsernames = [
Expand All @@ -24,6 +28,10 @@ describe('usernames-helper', () => {
'BoldGapOGY',
'ZoomEraQE0',
'WiryFernLEC',
'RudeFuel59E',
'MacroMealFK5',
'HappySnapWTT',
'BumpyEdgeH5Y',
];

for (let i = 0; i < addresses.length; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ describe('subaccount-username-generator', () => {
SubaccountUsernamesTable.findAll(
{}, [], {});

const expectedUsernames = [
'BumpyEdgeH5Y', // dydx1n88uc38xhjgxzw9nwre4ep2c8ga4fjxc575lnf
'HappySnapWTT', // dydx1n88uc38xhjgxzw9nwre4ep2c8ga4fjxc565lnf
'MacroMealFK5', // dydx199tqg4wdlnu4qjlxchpd7seg454937hjrknju4
];
expect(subaccountsWithUsernamesAfter.length).toEqual(subaccountsLength);
for (let i = 0; i < expectedUsernames.length; i++) {
expect(subaccountsWithUsernamesAfter[i].username).toEqual(expectedUsernames[i]);
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default async function runTask(): Promise<void> {
for (const subaccount of subaccountZerosWithoutUsername) {
for (let i = 0; i < config.ATTEMPT_PER_SUBACCOUNT; i++) {
const username: string = generateUsernameForSubaccount(
subaccount.subaccountId,
subaccount.address,
// Always use subaccountNum 0 for generation. Effectively we are
// generating one username per address. The fact that we are storing
// in the `subaccount_usernames` table is a tech debt.
Expand Down
Loading