Skip to content

Commit 4d3ade3

Browse files
committed
Clean up SubQL ECS image manifests
1 parent 44ed7dc commit 4d3ade3

20 files changed

Lines changed: 44 additions & 164 deletions

File tree

packages/chain-stats-subql/Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ COPY packages/chain-stats-subql/package.json packages/chain-stats-subql/bun.lock
1616
RUN bun install
1717
COPY packages/chain-stats-subql/ ./
1818
RUN set -e \
19-
&& if [ -d /app/dist ]; then \
20-
echo "Using prebuilt dist from build context"; \
21-
else \
22-
./node_modules/.bin/subql codegen; \
23-
./node_modules/.bin/subql build --output dist; \
24-
fi \
19+
&& rm -rf /app/dist \
20+
&& ./node_modules/.bin/subql codegen \
21+
&& ./node_modules/.bin/subql build --output dist \
2522
&& for i in 1 2 3 4 5; do [ -d /app/dist ] && break; sleep 1; done \
2623
&& if [ ! -d /app/dist ]; then \
2724
echo "SubQL build did not create /app/dist"; \

packages/chain-stats-subql/project.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ specVersion: 1.0.0
22
name: acala-stats
33
version: 1.0.0
44
description: 'statistics tokens data'
5-
repository: 'https://github.com/AcalaNetwork/acala-tokens-subql'
5+
repository: 'https://github.com/AcalaNetwork/acala-subql-services'
66
runner:
77
node:
88
name: "@subql/node"

packages/dex-subql-fixed/src/utils/queryPrice.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const getOracleValue = async (api: AnyApi, token: MaybeCurrency) => {
2121
throw new Error(`Oracle price source is unavailable for ${getTokenName(token)}`);
2222
}
2323

24-
const queryPriceFromOracle = async (api: AnyApi, _block: SubstrateBlock, token: MaybeCurrency) => {
24+
const queryPriceFromOracle = async (api: AnyApi, token: MaybeCurrency) => {
2525
const result = await getOracleValue(api, token);
2626
const value = result?.unwrapOrDefault?.() || result;
2727

@@ -106,7 +106,7 @@ const getKusdMarketPrice = async (api: AnyApi, block: SubstrateBlock) => {
106106
}
107107

108108
const getAusdMarketPrice = async (api: AnyApi, block: SubstrateBlock) => {
109-
const acaPrice = await queryPriceFromOracle(api, block as any, 'ACA')
109+
const acaPrice = await queryPriceFromOracle(api, 'ACA')
110110

111111
const pool = await getPool('ACA', 'AUSD')
112112

@@ -124,7 +124,7 @@ const getKsmMarketPrice = (api: AnyApi, block: SubstrateBlock) => {
124124
const stakingCurrency = api.consts.prices.getStakingCurrencyId;
125125
const stakingCurrencyName = getTokenName(stakingCurrency as any);
126126

127-
return queryPriceFromOracle(api, block as any, stakingCurrencyName)
127+
return queryPriceFromOracle(api, stakingCurrencyName)
128128
}
129129

130130
const getDotMarketPrice = async (api: AnyApi, block: SubstrateBlock) => {

packages/dex-subql-fixed/src/utils/tokenDecimals.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
AnyApi,
3+
MaybeCurrency,
34
forceToCurrencyName,
45
getERC20TokenAddressFromName,
56
getForeignAssetIdFromName,
@@ -14,7 +15,7 @@ import {
1415

1516
let tokenDecimals: Record<string, number> = {};
1617

17-
const getTokenName = (token: unknown) => forceToCurrencyName(token as any);
18+
const getTokenName = (token: MaybeCurrency) => forceToCurrencyName(token);
1819

1920
const hydrateNativeTokenDecimals = (api: AnyApi) => {
2021
if (Object.keys(tokenDecimals).length > 0) return;
@@ -27,7 +28,7 @@ const hydrateNativeTokenDecimals = (api: AnyApi) => {
2728
);
2829
};
2930

30-
export async function getTokenDecimals(api: AnyApi, token: unknown) {
31+
export async function getTokenDecimals(api: AnyApi, token: MaybeCurrency) {
3132
hydrateNativeTokenDecimals(api);
3233

3334
const name = getTokenName(token);

packages/dex-subql/acala-project.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ specVersion: 1.0.0
22
name: acala-dex
33
version: 1.0.0
44
description: 'statistics tokens data'
5-
repository: 'https://github.com/AcalaNetwork/acala-tokens-subql'
5+
repository: 'https://github.com/AcalaNetwork/acala-subql-services'
66
runner:
77
node:
88
name: "@subql/node"
@@ -58,4 +58,4 @@ dataSources:
5858
kind: substrate/EventHandler
5959
filter:
6060
module: dex
61-
method: AddProvision
61+
method: AddProvision

packages/dex-subql/karura-project.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ specVersion: 1.0.0
22
name: karura-dex
33
version: 1.0.0
44
description: 'statistics tokens data of karura network'
5-
repository: 'https://github.com/AcalaNetwork/acala-tokens-subql'
5+
repository: 'https://github.com/AcalaNetwork/acala-subql-services'
66
runner:
77
node:
88
name: "@subql/node"
@@ -58,4 +58,4 @@ dataSources:
5858
kind: substrate/EventHandler
5959
filter:
6060
module: dex
61-
method: AddProvision
61+
method: AddProvision

packages/dex-subql/project.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ specVersion: 1.0.0
22
name: acala-dex
33
version: 1.0.0
44
description: 'statistics tokens data'
5-
repository: 'https://github.com/AcalaNetwork/acala-tokens-subql'
5+
repository: 'https://github.com/AcalaNetwork/acala-subql-services'
66
runner:
77
node:
88
name: "@subql/node"

packages/dex-subql/src/utils/tokenDecimals.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
AnyApi,
3+
MaybeCurrency,
34
forceToCurrencyName,
45
getERC20TokenAddressFromName,
56
getForeignAssetIdFromName,
@@ -14,7 +15,7 @@ import {
1415

1516
let tokenDecimals: Record<string, number> = {};
1617

17-
const getTokenName = (token: unknown) => forceToCurrencyName(token as any);
18+
const getTokenName = (token: MaybeCurrency) => forceToCurrencyName(token);
1819

1920
const hydrateNativeTokenDecimals = (api: AnyApi) => {
2021
if (Object.keys(tokenDecimals).length > 0) return;
@@ -27,7 +28,7 @@ const hydrateNativeTokenDecimals = (api: AnyApi) => {
2728
);
2829
};
2930

30-
export async function getTokenDecimals(api: AnyApi, token: unknown) {
31+
export async function getTokenDecimals(api: AnyApi, token: MaybeCurrency) {
3132
hydrateNativeTokenDecimals(api);
3233

3334
const name = getTokenName(token);

packages/earn-subql/Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ COPY packages/earn-subql/package.json packages/earn-subql/bun.lock ./
1616
RUN bun install
1717
COPY packages/earn-subql/ ./
1818
RUN set -e \
19-
&& if [ -d /app/dist ]; then \
20-
echo "Using prebuilt dist from build context"; \
21-
else \
22-
./node_modules/.bin/subql codegen; \
23-
./node_modules/.bin/subql build --output dist; \
24-
fi \
19+
&& rm -rf /app/dist \
20+
&& ./node_modules/.bin/subql codegen \
21+
&& ./node_modules/.bin/subql build --output dist \
2522
&& for i in 1 2 3 4 5; do [ -d /app/dist ] && break; sleep 1; done \
2623
&& if [ ! -d /app/dist ]; then \
2724
echo "SubQL build did not create /app/dist"; \
@@ -52,6 +49,7 @@ COPY --from=builder /app/package.json /app/
5249
COPY --from=builder /app/schema.graphql /app/
5350
COPY --from=builder /app/dist /app/dist
5451
COPY --from=builder /app/project.yaml /app/
52+
COPY --from=builder /app/karura-project.yaml /app/
5553

5654
RUN chown -R 1000:1000 /app
5755

packages/earn-subql/acala-project.yaml

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)