fix: use call to getDefaultClientConfig to get chain config

This commit is contained in:
Derrick Hammer 2023-07-11 03:07:18 -04:00
parent 43ffe2b41c
commit 948d4d6109
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 1 deletions

View File

@ -30,6 +30,7 @@ export function getDefaultClientConfig() {
export function optimisticUpdateFromJSON(update: any): OptimisticUpdate { export function optimisticUpdateFromJSON(update: any): OptimisticUpdate {
return capella.ssz.LightClientOptimisticUpdate.fromJson(update); return capella.ssz.LightClientOptimisticUpdate.fromJson(update);
} }
export async function optimisticUpdateVerify( export async function optimisticUpdateVerify(
committee: Uint8Array[], committee: Uint8Array[],
update: OptimisticUpdate, update: OptimisticUpdate,
@ -49,7 +50,7 @@ export async function optimisticUpdateVerify(
try { try {
assertValidSignedHeader( assertValidSignedHeader(
this.config.chainConfig, getDefaultClientConfig().chainConfig,
committeeFast, committeeFast,
syncAggregate, syncAggregate,
headerBlockRoot, headerBlockRoot,
@ -75,6 +76,7 @@ export async function optimisticUpdateVerify(
return { correct: false, reason: (e as Error).message }; return { correct: false, reason: (e as Error).message };
} }
} }
export function deserializePubkeys(pubkeys) { export function deserializePubkeys(pubkeys) {
return pubkeys.map((pk) => bls.PublicKey.fromBytes(pk)); return pubkeys.map((pk) => bls.PublicKey.fromBytes(pk));
} }