Skip to content

Commit

Permalink
fix(protocol): integration test (#13279)
Browse files Browse the repository at this point in the history
  • Loading branch information
dionysuzx authored Mar 9, 2023
1 parent b6bda65 commit 0c871f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/protocol/test/utils/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type Block = {
uncles: string[];
baseFeePerGas?: string;
mixHash: string;
withdrawalsRoot: string;
};

type BlockHeader = {
Expand All @@ -56,6 +57,7 @@ type BlockHeader = {
mixHash: string;
nonce: number;
baseFeePerGas: number;
withdrawalsRoot: string;
};

async function getBlockHeader(
Expand Down Expand Up @@ -90,6 +92,8 @@ async function getBlockHeader(
mixHash: block.mixHash,
nonce: block.nonce,
baseFeePerGas: block.baseFeePerGas ? parseInt(block.baseFeePerGas) : 0,
// set to zero for pre-shanghai L1 blocks used in the integration test node
withdrawalsRoot: ethers.constants.HashZero,
};

return { block, blockHeader };
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/test/utils/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function getSignalProof(
// encode the SignalProof struct from LibBridgeSignal
const signalProof = ethers.utils.defaultAbiCoder.encode(
[
"tuple(tuple(bytes32 parentHash, bytes32 ommersHash, address beneficiary, bytes32 stateRoot, bytes32 transactionsRoot, bytes32 receiptsRoot, bytes32[8] logsBloom, uint256 difficulty, uint128 height, uint64 gasLimit, uint64 gasUsed, uint64 timestamp, bytes extraData, bytes32 mixHash, uint64 nonce, uint256 baseFeePerGas) header, bytes proof)",
"tuple(tuple(bytes32 parentHash, bytes32 ommersHash, address beneficiary, bytes32 stateRoot, bytes32 transactionsRoot, bytes32 receiptsRoot, bytes32[8] logsBloom, uint256 difficulty, uint128 height, uint64 gasLimit, uint64 gasUsed, uint64 timestamp, bytes extraData, bytes32 mixHash, uint64 nonce, uint256 baseFeePerGas, bytes32 withdrawalsRoot) header, bytes proof)",
],
[{ header: blockHeader, proof: encodedProof }]
);
Expand Down

0 comments on commit 0c871f9

Please sign in to comment.