diff --git a/automated-orders/packages/blockchain-library/src/clients/warden.ts b/automated-orders/packages/blockchain-library/src/clients/warden.ts index 591a6d045..6ff09debc 100644 --- a/automated-orders/packages/blockchain-library/src/clients/warden.ts +++ b/automated-orders/packages/blockchain-library/src/clients/warden.ts @@ -21,7 +21,7 @@ export class WardenClient { } async *pollSignatureRequests(): AsyncGenerator { - let nextKey: Uint8Array | undefined = new Uint8Array(); + let nextKey: Uint8Array | undefined = undefined; while (true) { await delay(this.configuration.pollingIntervalMsec); diff --git a/automated-orders/packages/utils-library/src/services/cache.ts b/automated-orders/packages/utils-library/src/services/cache.ts index 1897c6c5d..a96adfe24 100644 --- a/automated-orders/packages/utils-library/src/services/cache.ts +++ b/automated-orders/packages/utils-library/src/services/cache.ts @@ -41,7 +41,10 @@ export class LruCache { } private refresh(key: string) { - const entry = this.values.get(key)!; + const entry = this.values.get(key); + if (entry === undefined) { + throw new Error(`Key ${key} not found in cache`); + } this.values.delete(key); this.values.set(key, entry); return entry;