From ee2bf7375f3c36b6e3200cccc44a4b8e7e205e37 Mon Sep 17 00:00:00 2001 From: backsapc Date: Wed, 6 Nov 2024 23:36:40 +0300 Subject: [PATCH 1/2] Update automated-orders/packages/utils-library/src/services/cache.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../packages/utils-library/src/services/cache.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; From 11b74722e5c5a9247c739fff45ebddc5b64185e3 Mon Sep 17 00:00:00 2001 From: backsapc Date: Wed, 6 Nov 2024 23:37:49 +0300 Subject: [PATCH 2/2] Update automated-orders/packages/blockchain-library/src/clients/warden.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../packages/blockchain-library/src/clients/warden.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);