From b3e56071325e5d3363626094ed66bb949cd42168 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 13 Jul 2023 03:13:22 -0400 Subject: [PATCH] refactor: store optimistic update back into _latestOptimisticUpdate with a getter. --- src/baseClient.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/baseClient.ts b/src/baseClient.ts index 1d3a305..a06bc4c 100644 --- a/src/baseClient.ts +++ b/src/baseClient.ts @@ -129,6 +129,10 @@ export default abstract class BaseClient { console.error(`Invalid Optimistic Update: ${verify.reason}`); return null; } + + this._latestOptimisticUpdate = + capella.ssz.LightClientOptimisticUpdate.serialize(update); + console.log( `Optimistic update verified for slot ${update.attestedHeader.beacon.slot}`, );