Skip to content

Commit

Permalink
another console.log for ci
Browse files Browse the repository at this point in the history
  • Loading branch information
adraffy committed Oct 3, 2024
1 parent 8ab02f4 commit a4c655e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/eth/merkle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function verifyAccountState(
): AccountState | undefined {
const rlp = verifyMerkleTrieValue(target, accountProof, stateRoot, true);
if (!rlp) return;
console.log(target, rlp);
const decoded = assertRlpVector(rlp);
if (decoded.length != 4) throw new Error('invalid account state');
const [nonce, balance, storageRoot, codeHash] = decoded;
Expand Down Expand Up @@ -160,7 +161,7 @@ function walk(nodes: TrieNode[], key: HexString, root: HexString) {
function assertRlpVector(rlp: HexString) {
const v = decodeRlp(rlp);
if (!Array.isArray(v) || !v.every((x) => typeof x === 'string')) {
console.log(v);
console.log(rlp, v);
throw new Error('expected rlp vector');

Check failure on line 165 in src/eth/merkle.ts

View workflow job for this annotation

GitHub Actions / Test v2 on Node 20.x and ubuntu-latest

error: expected rlp vector

at assertRlpVector (/home/runner/work/unruggable-gateways/unruggable-gateways/src/eth/merkle.ts:165:11) at /home/runner/work/unruggable-gateways/unruggable-gateways/src/eth/merkle.ts:69:23 at map (1:11) at verifyMerkleTrieValue (/home/runner/work/unruggable-gateways/unruggable-gateways/src/eth/merkle.ts:68:37) at verifyStorageValue (/home/runner/work/unruggable-gateways/unruggable-gateways/src/eth/merkle.ts:48:15) at /home/runner/work/unruggable-gateways/unruggable-gateways/test/components/MerkleTrie.test.ts:48:29

Check failure on line 165 in src/eth/merkle.ts

View workflow job for this annotation

GitHub Actions / Test v2 on Node 20.x and ubuntu-latest

error: expected rlp vector

at assertRlpVector (/home/runner/work/unruggable-gateways/unruggable-gateways/src/eth/merkle.ts:165:11) at /home/runner/work/unruggable-gateways/unruggable-gateways/src/eth/merkle.ts:69:23 at map (1:11) at verifyMerkleTrieValue (/home/runner/work/unruggable-gateways/unruggable-gateways/src/eth/merkle.ts:68:37) at verifyStorageValue (/home/runner/work/unruggable-gateways/unruggable-gateways/src/eth/merkle.ts:48:15) at /home/runner/work/unruggable-gateways/unruggable-gateways/test/components/MerkleTrie.test.ts:48:29

Check failure on line 165 in src/eth/merkle.ts

View workflow job for this annotation

GitHub Actions / Test v2 on Node 20.x and ubuntu-latest

error: expected rlp vector

at assertRlpVector (/home/runner/work/unruggable-gateways/unruggable-gateways/src/eth/merkle.ts:165:11) at /home/runner/work/unruggable-gateways/unruggable-gateways/src/eth/merkle.ts:69:23 at map (1:11) at verifyMerkleTrieValue (/home/runner/work/unruggable-gateways/unruggable-gateways/src/eth/merkle.ts:68:37) at verifyStorageValue (/home/runner/work/unruggable-gateways/unruggable-gateways/src/eth/merkle.ts:48:15) at /home/runner/work/unruggable-gateways/unruggable-gateways/test/components/MerkleTrie.test.ts:48:29
}
return v as HexString[];
Expand Down
4 changes: 2 additions & 2 deletions src/linea/LineaGatewayV1.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LineaCommit, LineaRollup } from './LineaRollup.js';
import { isInclusionProof, LineaProof, LineaProofInclusion } from './types.js';
import { isInclusionProof, LineaProof, LineaInclusionProof } from './types.js';
import { GatewayV1 } from '../gateway.js';
import { GatewayRequestV1 } from '../v1.js';
import { ABI_CODER } from '../utils.js';
Expand Down Expand Up @@ -34,7 +34,7 @@ export class LineaGatewayV1 extends GatewayV1<LineaRollup> {
}
}

function encodeAccountProof(proof: LineaProofInclusion) {
function encodeAccountProof(proof: LineaInclusionProof) {
return [
proof.key,
proof.leafIndex,
Expand Down
6 changes: 3 additions & 3 deletions src/linea/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ export type LineaProofObject = {
value: HexString;
};

export type LineaProofExclusion = {
export type LineaExclusionProof = {
key: HexString32;
leftLeafIndex: number;
leftProof: LineaProofObject;
rightLeafIndex: number;
rightProof: LineaProofObject;
};

export type LineaProofInclusion = {
export type LineaInclusionProof = {
key: HexString32;
leafIndex: number;
proof: LineaProofObject;
};

export type LineaProof = LineaProofExclusion | LineaProofInclusion;
export type LineaProof = LineaExclusionProof | LineaInclusionProof;

export type RPCLineaGetProof = {
accountProof: LineaProof;
Expand Down

0 comments on commit a4c655e

Please sign in to comment.