Skip to content

Commit e200cf7

Browse files
authored
Merge pull request #2463 from balancer/refactor-modules
sts and sftmx module refactor
2 parents a003148 + 38f9505 commit e200cf7

23 files changed

+54
-178
lines changed

.changeset/beige-seas-accept.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'backend': patch
3+
---
4+
5+
refactor sts and sftmx module

apps/api/gql/resolvers/sftmx.resolvers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { SftmxController } from '../../../../modules/sftmx/sftmx-controller';
12
import { Resolvers } from '../generated-schema';
2-
import { SftmxController } from '../../../../modules/controllers';
33

44
const resolvers: Resolvers = {
55
Query: {

apps/api/gql/resolvers/sts.resolvers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { StakedSonicController } from '../../../../modules/sts/sts-controller';
12
import { Resolvers } from '../generated-schema';
2-
import { StakedSonicController } from '../../../../modules/controllers';
33

44
const resolvers: Resolvers = {
55
Query: {

apps/api/gql/resolvers/token.resolvers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { TokenController } from '../../../../modules/controllers/token-controlle
99
import config from '../../../../config';
1010
import { GraphQLError } from 'graphql';
1111
import { PricingService } from '../../../../modules/pricing';
12-
import { ContentController } from '../../../../modules/controllers';
12+
import { ContentController } from '../../../../modules/content/content-controller';
1313

1414
const resolvers: Resolvers = {
1515
Query: {

apps/worker/job-handlers.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@ import { syncLatestFXPrices } from '../../modules/token/latest-fx-price';
1515
import { chainIdToChain } from '../../modules/network/chain-id-to-chain';
1616
import { Chain } from '@prisma/client';
1717
import {
18-
SftmxController,
1918
CowAmmController,
2019
SnapshotsController,
21-
ContentController,
2220
PoolController,
2321
EventController,
2422
StakingController,
25-
StakedSonicController,
2623
UserBalancesController,
2724
QuantAmmController,
2825
TokenYieldsController,
@@ -34,11 +31,12 @@ import config from '../../config';
3431
import { LBPController } from '../../modules/controllers/lbp-controller';
3532
import { AprsController } from '../../modules/controllers/aprs-controller';
3633
import { LoopsService } from '../../modules/loops/service';
34+
import { ContentController } from '../../modules/content/content-controller';
35+
import { StakedSonicController } from '../../modules/sts/sts-controller';
36+
import { SftmxController } from '../../modules/sftmx/sftmx-controller';
3737

3838
const runningJobs: Set<string> = new Set();
3939

40-
const sftmxController = SftmxController();
41-
4240
async function runIfNotAlreadyRunning(
4341
id: string,
4442
chainId: string,
@@ -256,13 +254,19 @@ const setupJobHandlers = async (name: string, chainId: string, res: any, next: N
256254
);
257255
break;
258256
case 'sync-sftmx-staking-data':
259-
await runIfNotAlreadyRunning(name, chainId, () => sftmxController.syncSftmxStakingData(chainId), res, next);
257+
await runIfNotAlreadyRunning(
258+
name,
259+
chainId,
260+
() => SftmxController().syncSftmxStakingData(chainId),
261+
res,
262+
next,
263+
);
260264
break;
261265
case 'sync-sftmx-withdrawal-requests':
262266
await runIfNotAlreadyRunning(
263267
name,
264268
chainId,
265-
() => sftmxController.syncSftmxWithdrawalrequests(chainId),
269+
() => SftmxController().syncSftmxWithdrawalrequests(chainId),
266270
res,
267271
next,
268272
);

modules/actions/sftmx/sync-staking.service.test.ts

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

modules/actions/snapshots/v2-snapshot-query.ts

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

modules/actions/sts/sync-staking.service.test.ts

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

modules/controllers/cow-amm-controller.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { syncSnapshots } from '../actions/pool/sync-snapshots';
77
import { Chain, PrismaLastBlockSyncedCategory } from '@prisma/client';
88
import { syncBptBalancesFromSubgraph } from '../actions/user/bpt-balances/helpers/sync-bpt-balances-from-subgraph';
99
import { getLastSyncedBlock, upsertLastSyncedBlock } from '../actions/last-synced-block';
10-
import { updateLifetimeValues } from '../actions/pool/update-liftetime-values';
1110
import { syncTokenPairs } from '../actions/pool/v3/sync-tokenpairs';
1211

1312
export function CowAmmController(tracer?: any) {

modules/controllers/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
export * from './sftmx-controller';
2-
export * from './sts-controller';
31
export * from './snapshots-controller';
42
export * from './pool-mutation-controller';
53
export * from './user-balances-controller';
64
export * from './cow-amm-controller';
75
export * from './event-query-controller';
8-
export * from '../content/content-controller';
96
export * from './fx-pools-controller';
107
export * from './pool-controller';
118
export * from './event-controller';

0 commit comments

Comments
 (0)