From 17cb00231c44d734cb6f24f48d1a6a045f0c7ae4 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 13 Jul 2023 01:45:43 -0400 Subject: [PATCH] fix: simplify logic and use LightClientUpdate.fromJson --- src/prover.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/prover.ts b/src/prover.ts index 9f642ee..9a7d799 100644 --- a/src/prover.ts +++ b/src/prover.ts @@ -61,12 +61,8 @@ export default class Prover implements IProver { } } - for (let i = 0; i < trueCount; i++) { - updates.push( - capella.ssz.LightClientUpdate.deserialize(res[startPeriod + i]), - ); - } - - return updates; + return updates.concat( + res.map((u: any) => capella.ssz.LightClientUpdate.fromJson(u.data)), + ); } }