From 948d4d610939e4f19210c187eec9e03d89060cd4 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 11 Jul 2023 03:07:18 -0400 Subject: [PATCH] fix: use call to getDefaultClientConfig to get chain config --- src/util.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util.ts b/src/util.ts index 8bea121..29595f4 100644 --- a/src/util.ts +++ b/src/util.ts @@ -30,6 +30,7 @@ export function getDefaultClientConfig() { export function optimisticUpdateFromJSON(update: any): OptimisticUpdate { return capella.ssz.LightClientOptimisticUpdate.fromJson(update); } + export async function optimisticUpdateVerify( committee: Uint8Array[], update: OptimisticUpdate, @@ -49,7 +50,7 @@ export async function optimisticUpdateVerify( try { assertValidSignedHeader( - this.config.chainConfig, + getDefaultClientConfig().chainConfig, committeeFast, syncAggregate, headerBlockRoot, @@ -75,6 +76,7 @@ export async function optimisticUpdateVerify( return { correct: false, reason: (e as Error).message }; } } + export function deserializePubkeys(pubkeys) { return pubkeys.map((pk) => bls.PublicKey.fromBytes(pk)); }