diff --git a/src/composable/ConditionalOrder.spec.ts b/src/composable/ConditionalOrder.spec.ts index 92b89508..2b8499fd 100644 --- a/src/composable/ConditionalOrder.spec.ts +++ b/src/composable/ConditionalOrder.spec.ts @@ -16,7 +16,7 @@ jest.mock('./contracts') jest.mock('../order-book/api', () => { return { OrderBookApi: class MockedOrderBookApi { - getOrder = mockGetOrder //jest.fn(), + getOrder = mockGetOrder }, } }) diff --git a/src/composable/ConditionalOrder.ts b/src/composable/ConditionalOrder.ts index 6eea97b2..87399faa 100644 --- a/src/composable/ConditionalOrder.ts +++ b/src/composable/ConditionalOrder.ts @@ -302,7 +302,7 @@ export abstract class ConditionalOrder { // Let the concrete Conditional Order decide about the poll result (in the case the order is already in the orderbook) if (isOrderInOrderbook) { - const pollResult = await this.polledOrderInOrderbook(orderUid, order, params) + const pollResult = await this.handlePollFailedAlreadyPresent(orderUid, order, params) if (pollResult) { return pollResult } @@ -363,14 +363,14 @@ export abstract class ConditionalOrder { protected abstract pollValidate(params: PollParams): Promise /** - * This method lets the concrete conditional order decide what to do if the order yielded in the polling has been already created. + * This method lets the concrete conditional order decide what to do if the order yielded in the polling is already present in the Orderbook API. * * The concrete conditional order will have a chance to schedule the next poll. - * For example, a TWAP order that has the current part already in the orderbook, can signal that the next poll should be done at the time of the next part. + * For example, a TWAP order that has the current part already in the orderbook, can signal that the next poll should be done at the start time of the next part. * * @param params */ - protected abstract polledOrderInOrderbook( + protected abstract handlePollFailedAlreadyPresent( orderUid: UID, order: GPv2Order.DataStructOutput, params: PollParams diff --git a/src/composable/orderTypes/Twap.ts b/src/composable/orderTypes/Twap.ts index 5f828a76..6ab04f5c 100644 --- a/src/composable/orderTypes/Twap.ts +++ b/src/composable/orderTypes/Twap.ts @@ -351,7 +351,7 @@ export class Twap extends ConditionalOrder { return undefined } - protected async polledOrderInOrderbook( + protected async handlePollFailedAlreadyPresent( _orderUid: string, _order: GPv2Order.DataStructOutput, _params: PollParams diff --git a/src/composable/orderTypes/test/TestConditionalOrder.ts b/src/composable/orderTypes/test/TestConditionalOrder.ts index a84ba866..22cd6e48 100644 --- a/src/composable/orderTypes/test/TestConditionalOrder.ts +++ b/src/composable/orderTypes/test/TestConditionalOrder.ts @@ -52,7 +52,7 @@ export class TestConditionalOrder extends ConditionalOrder { protected async pollValidate(_params: PollParams): Promise { return undefined } - protected async polledOrderInOrderbook( + protected async handlePollFailedAlreadyPresent( _orderUid: string, _order: GPv2Order.DataStructOutput, _params: PollParams