fix: getConsensusOptimisticUpdate does not return

This commit is contained in:
Derrick Hammer 2023-07-11 01:54:01 -04:00
parent 911c95d9ee
commit 67827c3776
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 2 deletions

View File

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