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; }