fix: simplify logic and use LightClientUpdate.fromJson
This commit is contained in:
parent
76e22fa342
commit
17cb00231c
|
@ -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)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue