From 67827c3776171caf0699e5449307c3731fc81b9a Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 11 Jul 2023 01:54:01 -0400 Subject: [PATCH] fix: getConsensusOptimisticUpdate does not return --- src/util.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util.ts b/src/util.ts index 5e6e72d..bc014da 100644 --- a/src/util.ts +++ b/src/util.ts @@ -83,9 +83,11 @@ export async function getConsensusOptimisticUpdate() { `/eth/v1/beacon/light_client/optimistic_update`, ); - const updateJSON = resp.data; + const update = resp.data; - if (!updateJSON) { + if (!update) { throw Error(`fetching optimistic update failed`); } + + return update; }