Skip to content

Commit e2d1416

Browse files
committed
Remove unused plan lookup methods
Deleted the private methods findPlanById and getWorkspacePlan from PaymasterWorker as they are no longer used in the codebase.
1 parent e3b9a96 commit e2d1416

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

workers/paymaster/src/index.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -123,33 +123,6 @@ export default class PaymasterWorker extends Worker {
123123
await super.start();
124124
}
125125

126-
/**
127-
* Finds plan by id from cached plans
128-
*/
129-
private findPlanById(planId: WorkspaceDBScheme['tariffPlanId']): PlanDBScheme | undefined {
130-
return this.plans.find((plan) => plan._id.toString() === planId.toString());
131-
}
132-
133-
/**
134-
* Returns workspace plan, refreshes cache when plan is missing
135-
*/
136-
private async getWorkspacePlan(workspace: WorkspaceDBScheme): Promise<PlanDBScheme> {
137-
let currentPlan = this.findPlanById(workspace.tariffPlanId);
138-
139-
if (currentPlan) {
140-
return currentPlan;
141-
}
142-
143-
await this.fetchPlans();
144-
currentPlan = this.findPlanById(workspace.tariffPlanId);
145-
146-
if (!currentPlan) {
147-
throw new Error(`[Paymaster] Tariff plan ${workspace.tariffPlanId.toString()} not found for workspace ${workspace._id.toString()} (${workspace.name})`);
148-
}
149-
150-
return currentPlan;
151-
}
152-
153126
/**
154127
* Finish everything
155128
*/

0 commit comments

Comments
 (0)