Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
break;
}
case ExchangeEvents.Cancel: {
// Invalidate cache
const args = decodedLog.args as ExchangeCancelEventArgs;
this._orderFilledCancelledLazyStore.deleteIsCancelled(args.orderHash);
// Revalidate orders
const orderHash = args.orderHash;
const isOrderWatched = this._orderByOrderHash[orderHash] !== undefined;
if (isOrderWatched) {
await this._emitRevalidateOrdersAsync([orderHash], transactionHash);
}
break;
}
case ExchangeEvents.CancelUpTo: {
// TODO(logvinov): Do it smarter and actually look at the salt and order epoch
// Invalidate cache
const args = decodedLog.args as ExchangeCancelUpToEventArgs;
this._orderFilledCancelledLazyStore.deleteAllIsCancelled();
// Revalidate orders
const orderHashes = this._dependentOrderHashesTracker.getDependentOrderHashesByMaker(args.makerAddress);
await this._emitRevalidateOrdersAsync(orderHashes, transactionHash);
break;
}
default:
throw errorUtils.spawnSwitchErr('decodedLog.event', decodedLog.event);
}
}
private async _emitRevalidateOrdersAsync(orderHashes: string[], transactionHash?: string): Promise {
public async getCancelUpToEventsAsync(
startBlock: number,
endBlock: number,
): Promise>> {
const getCancelUpToEventsForRangeAsync = this._makeGetterFuncForEventType(
ExchangeEvents.CancelUpTo,
);
return getEventsWithPaginationAsync(getCancelUpToEventsForRangeAsync, startBlock, endBlock);
}