Skip to content

Commit

Permalink
feat: make e2e L1Resolver tests work on local stack
Browse files Browse the repository at this point in the history
  • Loading branch information
Julink-eth committed Jul 23, 2024
1 parent 5f4609a commit e3f5282
Show file tree
Hide file tree
Showing 7 changed files with 684 additions and 177 deletions.
6 changes: 6 additions & 0 deletions packages/linea-ccip-gateway/src/L2ProofService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ export class L2ProofService implements IProofService<L2ProvableBlock> {
): Promise<string> {
try {
let proof = await this.helper.getProofs(blockNo, address, slots);
if (!proof.accountProof) {
throw `No account proof on contract ${address} for block number ${blockNo}`;
}
if (proof.storageProofs.length === 0) {
throw `No storage proofs on contract ${address} for block number ${blockNo}`;
}
proof = this.checkStorageInitialized(proof);
return AbiCoder.defaultAbiCoder().encode(
[
Expand Down
9 changes: 5 additions & 4 deletions packages/linea-ens-resolver/.mocharc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"require": "ts-node/register",
"loader": "ts-node/esm",
"extensions": ["ts", "tsx"],
"spec": ["test/**/*.spec.*"],
"watch-files": ["src"]
}
"extensions": [
"ts",
"tsx"
]
}
4 changes: 2 additions & 2 deletions packages/linea-ens-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "1.0.0",
"description": "L1 contracts to resolve Linea ENS domains stored on Linea from L1",
"scripts": {
"test": "hardhat compile && cd ../linea-ccip-gateway && npm run build && cd ../linea-ens-resolver && mocha test/testL1Resolver.spec.ts --timeout 120000 --exit",
"test:local-stack": "hardhat compile && cd ../linea-ccip-gateway && npm run build && cd ../linea-ens-resolver && mocha test/testL1ResolverLocalStack.spec.ts --timeout 120000 --exit",
"test": "hardhat compile && cd ../linea-ccip-gateway && npm run build && cd ../linea-ens-resolver && mocha test/testL1Resolver.spec.ts --timeout 300000 --exit",
"test:local": "hardhat compile && cd ../linea-ccip-gateway && npm run build && cd ../linea-ens-resolver && mocha test/testL1ResolverLocal.spec.ts --timeout 300000 --exit",
"compile": "hardhat compile",
"clean": "rm -fr artifacts cache node_modules typechain-types"
},
Expand Down
Loading

0 comments on commit e3f5282

Please sign in to comment.