-
Notifications
You must be signed in to change notification settings - Fork 6
Chore/refactor hypersync #1809
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
base: dev
Are you sure you want to change the base?
Chore/refactor hypersync #1809
Changes from all commits
58862ef
5fe3987
1a1c72b
2cb4039
d0d4883
8e59ab9
20152b8
2c24319
db5e276
e90386a
187db53
dbcd82a
0290d61
6287b3d
f246df7
e891269
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| FROM node:20-slim AS base | ||
|
|
||
| FROM base AS builder | ||
| WORKDIR /app | ||
| COPY . . | ||
| RUN npx turbo@2.3.1 prune @anticapture/hypersync-indexer --docker | ||
|
|
||
| FROM base AS installer | ||
| RUN apt-get update && apt-get install -y curl && npm install -g pnpm ts-node | ||
| WORKDIR /app | ||
| COPY package.json package.json | ||
| COPY pnpm-lock.yaml pnpm-lock.yaml | ||
| COPY --from=builder /app/out/json/ . | ||
| RUN pnpm install | ||
| COPY --from=builder /app/out/full/ . | ||
| COPY --from=builder /app/turbo.json turbo.json | ||
| WORKDIR /app/apps/hypersync-indexer | ||
| RUN npm install --prefix generated --legacy-peer-deps | ||
| RUN pnpm envio codegen | ||
|
|
||
| FROM base AS runner | ||
| ENV NODE_ENV=production | ||
| RUN apt-get update && apt-get install -y curl && npm install -g ts-node | ||
| WORKDIR /app | ||
| COPY --from=installer /app . | ||
| WORKDIR /app/apps/hypersync-indexer | ||
|
|
||
| ENTRYPOINT ["npm", "run", "start"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ | |
| const createHistoryRow = ( | ||
| overrides: Partial<BalanceHistoryInsert> = {}, | ||
| ): BalanceHistoryInsert => ({ | ||
| id: "test-id", | ||
| transactionHash: TX_HASH, | ||
| daoId: DAO_ID, | ||
| accountId: VALID_ADDRESS, | ||
|
|
@@ -38,6 +39,7 @@ | |
| const createTransferRow = ( | ||
| overrides: Partial<TransferInsert> = {}, | ||
| ): TransferInsert => ({ | ||
| id: "test-id", | ||
| transactionHash: TX_HASH, | ||
| daoId: DAO_ID, | ||
| tokenId: TOKEN_ID, | ||
|
|
@@ -144,7 +146,7 @@ | |
|
|
||
| it("should accept orderBy=delta", async () => { | ||
| // Insert 2 rows with different delta/deltaMod values | ||
| await db.insert(balanceHistory).values([ | ||
|
Check failure on line 149 in apps/api/src/controllers/account-balance/historical.integration.test.ts
|
||
| createHistoryRow({ | ||
| transactionHash: TX_1, | ||
| delta: 100n, | ||
|
|
@@ -207,7 +209,7 @@ | |
|
|
||
| it("should accept orderDirection=asc", async () => { | ||
| // Insert 2 rows with different timestamps | ||
| await db.insert(balanceHistory).values([ | ||
|
Check failure on line 212 in apps/api/src/controllers/account-balance/historical.integration.test.ts
|
||
| createHistoryRow({ | ||
| transactionHash: TX_1, | ||
| timestamp: 1700000000n, | ||
|
|
@@ -248,7 +250,7 @@ | |
|
|
||
| it("should accept fromValue and toValue parameters", async () => { | ||
| // deltaMod=100n is within range [50, 200], deltaMod=10000n is outside | ||
| await db.insert(balanceHistory).values([ | ||
|
Check failure on line 253 in apps/api/src/controllers/account-balance/historical.integration.test.ts
|
||
| createHistoryRow({ | ||
| transactionHash: TX_1, | ||
| deltaMod: 100n, | ||
|
|
@@ -282,7 +284,7 @@ | |
|
|
||
| it("should accept fromDate and toDate parameters", async () => { | ||
| // timestamp=1700000000 is within [1699000000, 1701000000], timestamp=1695000000 is not | ||
| await db.insert(balanceHistory).values([ | ||
|
Check failure on line 287 in apps/api/src/controllers/account-balance/historical.integration.test.ts
|
||
| createHistoryRow({ | ||
| transactionHash: TX_1, | ||
| timestamp: 1700000000n, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ | |
| const createAccountBalanceRow = ( | ||
| overrides: Partial<AccountBalanceInsert> = {}, | ||
| ): AccountBalanceInsert => ({ | ||
| id: "test-id", | ||
| accountId: COUNTERPART, | ||
| tokenId: TOKEN_ID, | ||
| balance: 200000000000000000n, | ||
|
|
@@ -35,6 +36,7 @@ | |
| const createTransferRow = ( | ||
| overrides: Partial<TransferInsert> = {}, | ||
| ): TransferInsert => ({ | ||
| id: "test-id", | ||
| transactionHash: TX_HASH, | ||
| daoId: DAO_ID, | ||
| tokenId: TOKEN_ID, | ||
|
|
@@ -139,7 +141,7 @@ | |
| }); | ||
|
|
||
| it("should accept orderBy and orderDirection parameters", async () => { | ||
| await db.insert(accountBalance).values([ | ||
|
Check failure on line 144 in apps/api/src/controllers/account-balance/interactions.integration.test.ts
|
||
| createAccountBalanceRow({ accountId: COUNTERPART, balance: 100n }), | ||
| createAccountBalanceRow({ | ||
| accountId: COUNTERPART_2, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ | |
| const createAccountBalanceRow = ( | ||
| overrides: Partial<AccountBalanceInsert> = {}, | ||
| ): AccountBalanceInsert => ({ | ||
| id: "test-id", | ||
| accountId: VALID_ADDRESS, | ||
| tokenId: TOKEN_ID, | ||
| balance: 1200000000000000000n, | ||
|
|
@@ -44,6 +45,7 @@ | |
| const createTransferRow = ( | ||
| overrides: Partial<TransferInsert> = {}, | ||
| ): TransferInsert => ({ | ||
| id: "test-id", | ||
| transactionHash: | ||
| "0xabc1230000000000000000000000000000000000000000000000000000000001", | ||
| daoId: "ENS", | ||
|
|
@@ -153,7 +155,7 @@ | |
| }); | ||
|
|
||
| it("should accept orderBy=variation", async () => { | ||
| await db.insert(accountBalance).values([ | ||
|
Check failure on line 158 in apps/api/src/controllers/account-balance/listing.integration.test.ts
|
||
| createAccountBalanceRow({ accountId: VALID_ADDRESS, balance: 1000n }), | ||
| createAccountBalanceRow({ | ||
| accountId: SECOND_ADDRESS, | ||
|
|
@@ -219,7 +221,7 @@ | |
| }); | ||
|
|
||
| it("should accept orderDirection=asc", async () => { | ||
| await db.insert(accountBalance).values([ | ||
|
Check failure on line 224 in apps/api/src/controllers/account-balance/listing.integration.test.ts
|
||
| createAccountBalanceRow({ accountId: VALID_ADDRESS, balance: 1000n }), | ||
| createAccountBalanceRow({ | ||
| accountId: SECOND_ADDRESS, | ||
|
|
@@ -268,7 +270,7 @@ | |
| }); | ||
|
|
||
| it("should accept addresses filter", async () => { | ||
| await db.insert(accountBalance).values([ | ||
|
Check failure on line 273 in apps/api/src/controllers/account-balance/listing.integration.test.ts
|
||
| createAccountBalanceRow({ accountId: VALID_ADDRESS }), | ||
| createAccountBalanceRow({ | ||
| accountId: SECOND_ADDRESS, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ | |
| const createAccountBalanceRow = ( | ||
| overrides: Partial<AccountBalanceInsert> = {}, | ||
| ): AccountBalanceInsert => ({ | ||
| id: "test-id", | ||
| accountId: VALID_ADDRESS, | ||
| tokenId: TOKEN_ID, | ||
| balance: 1200000000000000000n, | ||
|
|
@@ -39,6 +40,7 @@ | |
| const createTransferRow = ( | ||
| overrides: Partial<TransferInsert> = {}, | ||
| ): TransferInsert => ({ | ||
| id: "test-id", | ||
| transactionHash: TX_HASH, | ||
| daoId: DAO_ID, | ||
| tokenId: TOKEN_ID, | ||
|
|
@@ -128,7 +130,7 @@ | |
| }); | ||
|
|
||
| it("should accept pagination parameters", async () => { | ||
| await db.insert(accountBalance).values([ | ||
|
Check failure on line 133 in apps/api/src/controllers/account-balance/variations.integration.test.ts
|
||
| createAccountBalanceRow({ accountId: VALID_ADDRESS, balance: 1000n }), | ||
| createAccountBalanceRow({ | ||
| accountId: SECOND_ADDRESS, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to
infra/and add arailway.jsonfile