Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNi245 committed Sep 7, 2023
1 parent e0b177e commit cee767a
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions gateway/handler/optimism-bedrock/optimismBedrockHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,34 @@ export async function optimismBedrockHandler(

// for each proof request, create a proof
const proofs = await Promise.all(
proofRequests.map(async ({ target, slot, layout, result }: {
target: string;
slot: string;
layout: StorageLayout;
result: string;
}) => {
if (!target || !slot || layout === undefined) {
throw new Error('optimismBedrockHandler : Invalid data source response');
}

const { proof, result: proofResult } = await new ProofService(l1Provider, l2Provider).createProof(
proofRequests.map(
async ({
target,
slot,
layout,
);

console.log('Proof result: ', proofResult);

const proofParamType = await getProofParamType();
return ethers.utils.defaultAbiCoder.encode(['bytes', proofParamType], [result, proof]);
}),
result,
}: {
target: string;
slot: string;
layout: StorageLayout;
result: string;
}) => {
if (!target || !slot || layout === undefined) {
throw new Error('optimismBedrockHandler : Invalid data source response');
}

const { proof, result: proofResult } = await new ProofService(l1Provider, l2Provider).createProof(
target,
slot,
layout,
);

console.log('Proof result: ', proofResult);

const proofParamType = await getProofParamType();
return ethers.utils.defaultAbiCoder.encode(['bytes', proofParamType], [result, proof]);
},
),
);
// return the proofs as bytes array
return ethers.utils.defaultAbiCoder.encode(['bytes[]'], [proofs]);
Expand Down

0 comments on commit cee767a

Please sign in to comment.