diff --git a/src/index.ts b/src/index.ts index 6e7f527..cfdec87 100644 --- a/src/index.ts +++ b/src/index.ts @@ -38,11 +38,9 @@ const plugin: Plugin = { throw new Error('count required and must be a number"'); } - let hashes: Uint8Array = new Uint8Array(); - for (let i = 0; i < 4; i++) { try { - hashes = client.store.getCommitteeHashes( + return await client.store.getCommitteeHashes( request.start, request.count, ); @@ -54,7 +52,7 @@ const plugin: Plugin = { } } - return hashes; + return new Uint8Array(); }, }); @@ -76,11 +74,9 @@ const plugin: Plugin = { await client.sync(); } - let committee; - for (let i = 0; i < 4; i++) { try { - committee = client.store.getCommittee( + return await client.store.getCommittee( request.period === "latest" ? client.latestPeriod : request.period, @@ -93,15 +89,7 @@ const plugin: Plugin = { } } - try { - committee = client.store.getCommittee( - request.period === "latest" ? client.latestPeriod : request.period, - ); - } catch { - await client.sync(); - } - - return committee; + return new Uint8Array(); }, });