File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 */
You can’t perform that action at this time.
0 commit comments