Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
e6b8c29
fix: L2 zkfoundry test infrastructure for ZKsync mode
claude Jan 13, 2026
0540552
style: fix prettier formatting in L2 test files
claude Jan 13, 2026
6717e51
style: apply project prettier formatting
claude Jan 13, 2026
01d3d23
fix: remove hardcoded absolute path from foundry.toml
claude Jan 14, 2026
8049e90
refactor: replace hardcoded 0x01 with NEW_ENCODING_VERSION constant
claude Jan 15, 2026
29d776b
test: add unit tests for ChainAdminOwnable and TransitionaryOwner
claude Jan 15, 2026
2cdbd8a
test: add unit tests for UpgradeStageValidator, Bytes, and Calldata
claude Jan 15, 2026
352d02a
test: add InteroperableAddress library unit tests
claude Jan 15, 2026
9a22bad
test: add additional unit tests for GatewayTransactionFilterer and Se…
claude Jan 15, 2026
1d9d727
test: add unit tests for L2ProxyAdminDeployer and SemVer library
claude Jan 15, 2026
9e4e6a1
chore: add foundry-zksync and lock files to gitignore
claude Jan 15, 2026
76d6002
test: add unit tests for UpgradeableBeaconDeployer, RestrictionValida…
claude Jan 16, 2026
a5f9f20
test: add unit tests for LegacySharedBridgeAddresses library
claude Jan 16, 2026
2f46e1e
test: add unit tests for ChainRegistrar contract
claude Jan 16, 2026
73f533f
test: add comprehensive unit tests for DataEncoding library
claude Jan 16, 2026
e4bb729
test: add comprehensive unit tests for MessageHashing library
claude Jan 16, 2026
982e194
test: add unit tests for DynamicIncrementalMerkle, LibMap, Transactio…
claude Jan 16, 2026
73ae6b3
test: add unit tests for UncheckedMath and TransientPrimitives
claude Jan 16, 2026
1fe77ab
test: add unit tests for PriorityQueue library
claude Jan 16, 2026
a4c6039
test: add unit tests for ReentrancyGuard
claude Jan 16, 2026
195ff16
test: add unit tests for BatchDecoder, Diamond, FullMerkle, Merkle, a…
claude Jan 16, 2026
02a6772
test: add unit tests for PriorityTree library
claude Jan 16, 2026
3f56a3e
style: apply forge fmt to library test files
claude Jan 16, 2026
3503180
test: add unit tests for DynamicIncrementalMerkleMemory library
claude Jan 16, 2026
4f2989b
test: add unit tests for ValidiumL1DAValidator
claude Jan 16, 2026
89ee187
test: add unit tests for InteropDataEncoding and AttributesDecoder
claude Jan 16, 2026
3144a04
test: add unit tests for verifiers, DA gateway, and state-transition …
claude Jan 16, 2026
d4c71e3
test: add comprehensive unit tests for BridgedStandardERC20
claude Jan 16, 2026
89b0eeb
test: add comprehensive unit tests for L2WrappedBaseToken
claude Jan 16, 2026
4abc0ba
test: add extended unit tests for L2ContractHelper library
claude Jan 16, 2026
fc990ec
feat: add yarn commands for generating untested lines report
claude Jan 16, 2026
e870113
test: add AddressAliasHelper 7702 tests and fix coverage report
claude Jan 16, 2026
d402752
chore: add UNTESTED_LINES_REPORT.md to gitignore
claude Jan 16, 2026
10e68c8
generate-untest-lines fix
kelemeno Jan 16, 2026
5f6daf6
fix: use foundry-zksync/forge in coverage scripts
claude Jan 16, 2026
aed2472
Revert "fix: use foundry-zksync/forge in coverage scripts"
kelemeno Jan 16, 2026
3e2d0e6
fix: filter L2-only contracts from coverage report
claude Jan 16, 2026
264f660
test: add unit tests for Admin and GWAssetTracker
claude Jan 16, 2026
b353a65
test: add more unit tests for Admin and L1MessageRoot
claude Jan 16, 2026
d1123d0
test: extend GWAssetTracker and L1NativeTokenVault tests
claude Jan 16, 2026
f9fb0ca
test: add comprehensive unit tests to improve coverage
claude Jan 16, 2026
f5e314e
test: add unit tests for ZKsyncOSChainTypeManager, Getters and L1Mess…
claude Jan 16, 2026
bef77eb
test: add ZKChainBase modifier tests and utility functions
claude Jan 16, 2026
da4d1eb
test: extend GWAssetTracker tests with additional coverage
claude Jan 16, 2026
2c53166
test: add comprehensive unit tests for ChainTypeManager, Bridgehub, N…
claude Jan 16, 2026
69195a3
test: add SettlementLayerV31Upgrade tests and extend GWAssetTracker t…
claude Jan 16, 2026
aad9a21
test: add tests for ValidatorTimelock, PermanentRestriction, L1Nullif…
claude Jan 16, 2026
7f7a363
more tests
kelemeno Jan 17, 2026
9f3ae97
test: add extended tests for increased contract coverage
claude Jan 17, 2026
2822ad2
more GWAT coverage
kelemeno Jan 17, 2026
967d7cd
fix tests
kelemeno Jan 17, 2026
db939bd
test: add tests for L1NativeTokenVault, Admin facet, and GWAssetTracker
claude Jan 17, 2026
f3b0745
fix: correct UtilsFacet selectors array size from 57 to 59
claude Jan 17, 2026
b3b479b
fix: correct ZKChainCommitment struct field ordering in Admin tests
claude Jan 17, 2026
be0922e
build issues
kelemeno Jan 17, 2026
690d866
fix: correct test assertions for GWAssetTracker and L1NativeTokenVault
claude Jan 17, 2026
f697bf6
test: add Mailbox constructor and onlyL1 modifier tests
claude Jan 17, 2026
86259d7
test: add GWAssetTracker test helper getLegacySharedBridgeAddress
claude Jan 17, 2026
a81bc97
test: add more forwardedBridgeBurn error case tests for Admin facet
claude Jan 17, 2026
fa0ca8e
test: add Executor revert batches tests for uncovered error paths
claude Jan 17, 2026
94f9e87
test: add more tests for Executor and Mailbox coverage
claude Jan 17, 2026
a9c8a8a
linting
kelemeno Jan 17, 2026
f82ff13
Merge branch 'claude/implement-feature-mkg0qknhgvlcv5r6-Lf6Eq' of ssh…
kelemeno Jan 17, 2026
6a3b723
linting more
kelemeno Jan 17, 2026
d7631a3
test: add Admin facet tests for uncovered code paths
claude Jan 17, 2026
8a55c90
test: add BridgehubBase tests for uncovered code paths
claude Jan 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ yarn-debug.log*
yarn-error.log*
l1-contracts/yarn-error.log*
l1-contracts/lcov.info
l1-contracts/UNTESTED_LINES_REPORT.md
l1-contracts/report/*
l1-contracts/coverage/*
l1-contracts/out/*
Expand All @@ -37,3 +38,10 @@ l1-contracts/test/foundry/integration/deploy-scripts/script-out/*
l1-contracts/test/foundry/l1/integration/upgrade-envs/script-out/*.toml
l1-contracts/zkout/*
.lycheecache

# Foundry binary
foundry-zksync/
l1-contracts/foundry-zksync/

# Lock files
l1-contracts/test/foundry/l1/integration/deploy-scripts/script-config/.lock
4 changes: 2 additions & 2 deletions l1-contracts/deploy-scripts/AdminFunctions.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {BridgehubBurnCTMAssetData} from "contracts/core/bridgehub/IBridgehubBase
import {AddressAliasHelper} from "contracts/vendor/AddressAliasHelper.sol";
import {L2_ASSET_ROUTER_ADDR} from "contracts/common/l2-helpers/L2ContractAddresses.sol";
import {IL2AssetRouter} from "contracts/bridge/asset-router/IL2AssetRouter.sol";
import {NEW_ENCODING_VERSION} from "contracts/bridge/asset-router/IAssetRouterBase.sol";
import {L2DACommitmentScheme} from "contracts/common/Config.sol";

bytes32 constant SET_TOKEN_MULTIPLIER_SETTER_ROLE = keccak256("SET_TOKEN_MULTIPLIER_SETTER_ROLE");
Expand Down Expand Up @@ -515,8 +516,7 @@ contract AdminFunctions is Script, IAdminFunctions {
})
);

// TODO: use constant for the 0x01
secondBridgeData = abi.encodePacked(bytes1(0x01), abi.encode(chainAssetId, bridgehubData));
secondBridgeData = abi.encodePacked(NEW_ENCODING_VERSION, abi.encode(chainAssetId, bridgehubData));
}

calls = Utils.prepareAdminL1L2TwoBridgesTransaction(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {ValidatorTimelock} from "contracts/state-transition/ValidatorTimelock.so
import {IAdmin} from "contracts/state-transition/chain-interfaces/IAdmin.sol";
import {GatewayTransactionFilterer} from "contracts/transactionFilterer/GatewayTransactionFilterer.sol";
import {TransparentUpgradeableProxy} from "@openzeppelin/contracts-v4/proxy/transparent/TransparentUpgradeableProxy.sol";
import {IAssetRouterBase, SET_ASSET_HANDLER_COUNTERPART_ENCODING_VERSION} from "contracts/bridge/asset-router/IAssetRouterBase.sol";
import {IAssetRouterBase, SET_ASSET_HANDLER_COUNTERPART_ENCODING_VERSION, NEW_ENCODING_VERSION} from "contracts/bridge/asset-router/IAssetRouterBase.sol";
import {CTM_DEPLOYMENT_TRACKER_ENCODING_VERSION} from "contracts/core/ctm-deployment/CTMDeploymentTracker.sol";
import {IL2AssetRouter, L2AssetRouter} from "contracts/bridge/asset-router/L2AssetRouter.sol";
import {L1Nullifier} from "contracts/bridge/L1Nullifier.sol";
Expand Down Expand Up @@ -165,7 +165,7 @@ abstract contract GatewayGovernanceUtils is Script {
// chains that migrate from L1.
{
bytes memory secondBridgeData = abi.encodePacked(
bytes1(0x01),
NEW_ENCODING_VERSION,
abi.encode(_gatewayGovernanceConfig.chainTypeManagerProxy, prepareGWGovCallsStruct._gatewayCTMAddress)
);

Expand Down
7 changes: 3 additions & 4 deletions l1-contracts/deploy-scripts/gateway/GatewayPreparation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {ValidatorTimelock} from "contracts/state-transition/ValidatorTimelock.so
import {IAdmin} from "contracts/state-transition/chain-interfaces/IAdmin.sol";
import {GatewayTransactionFilterer} from "contracts/transactionFilterer/GatewayTransactionFilterer.sol";
import {TransparentUpgradeableProxy} from "@openzeppelin/contracts-v4/proxy/transparent/TransparentUpgradeableProxy.sol";
import {SET_ASSET_HANDLER_COUNTERPART_ENCODING_VERSION} from "contracts/bridge/asset-router/IAssetRouterBase.sol";
import {SET_ASSET_HANDLER_COUNTERPART_ENCODING_VERSION, NEW_ENCODING_VERSION} from "contracts/bridge/asset-router/IAssetRouterBase.sol";

import {IL2AssetRouter, L2AssetRouter} from "contracts/bridge/asset-router/L2AssetRouter.sol";
import {L1Nullifier} from "contracts/bridge/L1Nullifier.sol";
Expand Down Expand Up @@ -314,7 +314,7 @@ contract GatewayPreparation is Script {
initializeConfig();

bytes memory secondBridgeData = abi.encodePacked(
bytes1(0x01),
NEW_ENCODING_VERSION,
abi.encode(config.chainTypeManagerProxy, gatewayCTMAddress)
);

Expand Down Expand Up @@ -405,8 +405,7 @@ contract GatewayPreparation is Script {
})
);

// TODO: use constant for the 0x01
bytes memory secondBridgeData = abi.encodePacked(bytes1(0x01), abi.encode(chainAssetId, bridgehubData));
bytes memory secondBridgeData = abi.encodePacked(NEW_ENCODING_VERSION, abi.encode(chainAssetId, bridgehubData));

bytes32 l2TxHash = Utils.runAdminL1L2TwoBridgesTransaction(
_getL1GasPrice(),
Expand Down
1 change: 1 addition & 0 deletions l1-contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ fs_permissions = [
{ access = "read", path = "zkout" },
{ access = "read", path = "./deploy-scripts/evm-predeploys/evm-predeploy-datas" },
{ access = "read", path = "../configs/genesis/" },
{ access = "read", path = "../configs/" },
]
ignored_error_codes = ["missing-receive-ether", "code-size"]
ignored_warnings_from = ["test", "contracts/dev-contracts"]
Expand Down
4 changes: 3 additions & 1 deletion l1-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@
"test:invariant:l1-context": "WHERE=L1 scripts/run-invariant-tests",
"test:invariant:l2-context": "WHERE=L2 scripts/run-invariant-tests",
"coverage:foundry": "forge coverage --ffi --match-path 'test/foundry/l1/*' --no-match-coverage 'contracts/(bridge/.*L2.*\\.sol|governance/L2AdminFactory\\.sol|state-transition/L2TestnetVerifier\\.sol|state-transition/L2Verifier\\.sol|state-transition/verifiers/.*\\.sol)' --no-match-test 'test_StageProofsForkScriptBased|test_StageProofsForkFileBased|test_DefaultUpgrade' --no-match-contract 'ChainRegistrarTest'",
"coverage-report": "forge coverage --report lcov --ffi --match-path 'test/foundry/l1/*' --no-match-coverage 'contracts/(governance/L2AdminFactory\\.sol|state-transition/L2TestnetVerifier\\.sol|state-transition/L2Verifier\\.sol|state-transition/verifiers/.*\\.sol)' --no-match-test 'test_StageProofsForkScriptBased|test_StageProofsForkFileBased|test_DefaultUpgrade' --no-match-contract 'ChainRegistrarTest' && genhtml -o report lcov.info --branch-coverage --ignore-errors category lcov.info --ignore-errors inconsistent",
"coverage-report": "forge coverage --report lcov -r ./lcov.info --ffi --match-path 'test/foundry/l1/*' --no-match-coverage 'contracts/(governance/L2AdminFactory\\.sol|state-transition/L2TestnetVerifier\\.sol|state-transition/L2Verifier\\.sol|state-transition/verifiers/.*\\.sol)' --no-match-test 'test_StageProofsForkScriptBased|test_StageProofsForkFileBased|test_DefaultUpgrade' --no-match-contract 'ChainRegistrarTest' && genhtml -o report lcov.info --branch-coverage --ignore-errors category lcov.info --ignore-errors inconsistent",
"coverage-untested": "yarn coverage-report && ts-node scripts/generate-untested-lines-report.ts ./lcov.info ./UNTESTED_LINES_REPORT.md",
"coverage-untested-quick": "ts-node scripts/generate-untested-lines-report.ts ./lcov.info ./UNTESTED_LINES_REPORT.md",
"deploy-no-build": "ts-node scripts/deploy.ts",
"register-zk-chain": "ts-node scripts/register-zk-chain.ts",
"deploy-weth-bridges": "ts-node scripts/deploy-weth-bridges.ts",
Expand Down
220 changes: 220 additions & 0 deletions l1-contracts/scripts/generate-untested-lines-report.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
import * as fs from "fs";

/**
* This script parses an lcov.info file and generates a report of untested lines.
* Usage: ts-node scripts/generate-untested-lines-report.ts [lcov-file-path] [output-file-path]
*
* If no arguments provided, uses defaults:
* - lcov file: ./lcov.info
* - output file: ./UNTESTED_LINES_REPORT.md
*/

interface FileInfo {
path: string;
totalLines: number;
coveredLines: number;
untestedLines: number[];
coveragePercent: number;
}

interface ParsedLcov {
files: Map<string, FileInfo>;
}

function parseLcov(lcovContent: string): ParsedLcov {
const files = new Map<string, FileInfo>();
let currentFile: FileInfo | null = null;

const lines = lcovContent.split("\n");

for (const line of lines) {
if (line.startsWith("SF:")) {
// Source file
const filePath = line.substring(3);
currentFile = {
path: filePath,
totalLines: 0,
coveredLines: 0,
untestedLines: [],
coveragePercent: 0,
};
} else if (line.startsWith("DA:") && currentFile) {
// Data line: DA:line_number,hit_count
const parts = line.substring(3).split(",");
const lineNumber = parseInt(parts[0], 10);
const hitCount = parseInt(parts[1], 10);

if (hitCount === 0) {
currentFile.untestedLines.push(lineNumber);
}
} else if (line.startsWith("LF:") && currentFile) {
// Lines Found (total executable lines)
currentFile.totalLines = parseInt(line.substring(3), 10);
} else if (line.startsWith("LH:") && currentFile) {
// Lines Hit (covered lines)
currentFile.coveredLines = parseInt(line.substring(3), 10);
} else if (line === "end_of_record" && currentFile) {
// End of file record
if (currentFile.totalLines > 0) {
currentFile.coveragePercent = (currentFile.coveredLines / currentFile.totalLines) * 100;
files.set(currentFile.path, currentFile);
}
currentFile = null;
}
}

return { files };
}

function generateReport(parsed: ParsedLcov, outputPath: string): void {
const fileInfos = Array.from(parsed.files.values());

// Filter to contract files only (matching forge coverage calculation)
// Also exclude L2-only contracts that cannot be tested with L1 tests
const contractFiles = fileInfos.filter(
(f) =>
(f.path.includes("/contracts/") || f.path.startsWith("contracts/")) &&
!f.path.includes("/test/") &&
!f.path.includes("/dev-contracts/") &&
!f.path.includes("Mock") &&
!f.path.includes("Test") &&
// Exclude L2-only contracts (cannot be tested with L1 foundry tests)
!f.path.includes("L2NativeTokenVault") &&
!f.path.includes("L2AssetRouter") &&
!f.path.includes("L2AssetTracker") &&
!f.path.includes("L2Bridgehub") &&
!f.path.includes("L2SharedBridgeLegacy") &&
!f.path.includes("L2ChainAssetHandler") &&
!f.path.includes("L2MessageRoot") &&
!f.path.includes("L2WrappedBaseToken") &&
!f.path.includes("InteropCenter") &&
!f.path.includes("InteropHandler") &&
!f.path.includes("/l2-upgrades/") &&
!f.path.includes("/l2-system/")
);

// Filter to only files with untested lines for detailed reporting
const filesWithUntestedLines = contractFiles.filter((f) => f.untestedLines.length > 0);

// Sort by number of untested lines (descending)
filesWithUntestedLines.sort((a, b) => b.untestedLines.length - a.untestedLines.length);

// Generate markdown report
const lines: string[] = [];
lines.push("# Untested Lines Report");
lines.push("");
lines.push(`Generated at: ${new Date().toISOString()}`);
lines.push("");
lines.push("This report shows all source code files with untested lines,");
lines.push("sorted by number of untested lines (highest first).");
lines.push("");
lines.push("## Summary");
lines.push("");

// Calculate overall coverage from contract files (matching forge coverage behavior)
const totalLines = contractFiles.reduce((sum, f) => sum + f.totalLines, 0);
const totalCovered = contractFiles.reduce((sum, f) => sum + f.coveredLines, 0);
const totalUntested = filesWithUntestedLines.reduce((sum, f) => sum + f.untestedLines.length, 0);
const overallCoverage = totalLines > 0 ? (totalCovered / totalLines) * 100 : 0;

lines.push(`- **Total files with untested code:** ${filesWithUntestedLines.length}`);
lines.push(`- **Total untested lines:** ${totalUntested}`);
lines.push(`- **Total executable lines:** ${totalLines}`);
lines.push(`- **Overall line coverage:** ${overallCoverage.toFixed(2)}%`);
lines.push("");
lines.push("## Files with Untested Lines");
lines.push("");

// Table header
lines.push("| File | Coverage | Untested Lines | Specific Lines |");
lines.push("|------|----------|----------------|----------------|");

for (const file of filesWithUntestedLines) {
// Simplify path for display
const displayPath = file.path.replace(/^.*\/contracts\//, "contracts/");

// Format untested lines as ranges where possible
const lineRanges = formatLineRanges(file.untestedLines);

// Truncate line ranges if too long
const maxRangeLength = 300;
const truncatedRanges =
lineRanges.length > maxRangeLength ? lineRanges.substring(0, maxRangeLength) + "..." : lineRanges;

lines.push(
`| ${displayPath} | ${file.coveragePercent.toFixed(1)}% | ${file.untestedLines.length} | ${truncatedRanges} |`
);
}

lines.push("");
lines.push("## Detailed Untested Lines by File");
lines.push("");

for (const file of filesWithUntestedLines.slice(0, 30)) {
// Top 30 files
const displayPath = file.path.replace(/^.*\/contracts\//, "contracts/");
lines.push(`### ${displayPath}`);
lines.push("");
lines.push(`- Coverage: ${file.coveragePercent.toFixed(2)}%`);
lines.push(`- Total lines: ${file.totalLines}`);
lines.push(`- Covered lines: ${file.coveredLines}`);
lines.push(`- Untested lines (${file.untestedLines.length}): ${formatLineRanges(file.untestedLines)}`);
lines.push("");
}

if (filesWithUntestedLines.length > 30) {
lines.push(`... and ${filesWithUntestedLines.length - 30} more files with untested code.`);
lines.push("");
}

// Write report
fs.writeFileSync(outputPath, lines.join("\n"));
console.log(`Report generated: ${outputPath}`);
}

function formatLineRanges(lineNumbers: number[]): string {
if (lineNumbers.length === 0) return "";

const sorted = [...lineNumbers].sort((a, b) => a - b);
const ranges: string[] = [];
let rangeStart = sorted[0];
let rangeEnd = sorted[0];

for (let i = 1; i < sorted.length; i++) {
if (sorted[i] === rangeEnd + 1) {
rangeEnd = sorted[i];
} else {
ranges.push(rangeStart === rangeEnd ? `${rangeStart}` : `${rangeStart}-${rangeEnd}`);
rangeStart = sorted[i];
rangeEnd = sorted[i];
}
}
ranges.push(rangeStart === rangeEnd ? `${rangeStart}` : `${rangeStart}-${rangeEnd}`);

return ranges.join(", ");
}

// Main execution
const args = process.argv.slice(2);
const lcovPath = args[0] || "./lcov.info";
const outputPath = args[1] || "./UNTESTED_LINES_REPORT.md";

if (!fs.existsSync(lcovPath)) {
console.error(`Error: lcov file not found at ${lcovPath}`);
console.error("");
console.error("Please run coverage first:");
console.error(" yarn coverage-report");
console.error("");
console.error("Or specify a different lcov file:");
console.error(" ts-node scripts/generate-untested-lines-report.ts <lcov-file> [output-file]");
process.exit(1);
}

console.log(`Reading lcov from: ${lcovPath}`);
const lcovContent = fs.readFileSync(lcovPath, "utf-8");

console.log("Parsing lcov data...");
const parsed = parseLcov(lcovContent);

console.log(`Found ${parsed.files.size} files in lcov data`);
generateReport(parsed, outputPath);
14 changes: 10 additions & 4 deletions l1-contracts/test/foundry/l1/integration/L1GatewayTests.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {L2CanonicalTransaction, L2Message, TxStatus, ConfirmTransferResultData}
import {IL1Nullifier} from "contracts/bridge/interfaces/IL1Nullifier.sol";

import {IL1AssetRouter} from "contracts/bridge/asset-router/IL1AssetRouter.sol";
import {IAssetRouterBase} from "contracts/bridge/asset-router/IAssetRouterBase.sol";
import {IAssetRouterBase, NEW_ENCODING_VERSION} from "contracts/bridge/asset-router/IAssetRouterBase.sol";
import {AssetRouterBase} from "contracts/bridge/asset-router/AssetRouterBase.sol";

import {IGetters, IZKChain} from "contracts/state-transition/chain-interfaces/IZKChain.sol";
Expand Down Expand Up @@ -367,7 +367,9 @@ contract L1GatewayTests is
_mockMessageInclusion(gatewayChainId, merkleProofData, TxStatus.Success);

// Reverts if deposit was faked
bytes32 txDataHash = keccak256(bytes.concat(bytes1(0x01), abi.encode(chainAdmin, assetId, transferData)));
bytes32 txDataHash = keccak256(
bytes.concat(NEW_ENCODING_VERSION, abi.encode(chainAdmin, assetId, transferData))
);
vm.expectRevert(abi.encodeWithSelector(DepositDoesNotExist.selector, bytes32(0), txDataHash));
addresses.l1Nullifier.bridgeConfirmTransferResult(transferResultData);
}
Expand All @@ -382,7 +384,9 @@ contract L1GatewayTests is
uint256 amount = 1 ether;
bytes memory transferData = abi.encode(amount, alice, ETH_TOKEN_ADDRESS);
//bytes32 txDataHash = keccak256(abi.encode(alice, ETH_TOKEN_ADDRESS, amount));
bytes32 txDataHash = keccak256(bytes.concat(bytes1(0x01), abi.encode(alice, ETH_TOKEN_ASSET_ID, transferData)));
bytes32 txDataHash = keccak256(
bytes.concat(NEW_ENCODING_VERSION, abi.encode(alice, ETH_TOKEN_ASSET_ID, transferData))
);
_setDepositHappened(migratingChainId, merkleProofData.l2TxHash, txDataHash);
require(
addresses.l1Nullifier.depositHappened(migratingChainId, merkleProofData.l2TxHash) == txDataHash,
Expand Down Expand Up @@ -509,7 +513,9 @@ contract L1GatewayTests is
bytes memory transferData = _getTransferData();

// Set Deposit Happened
bytes32 txDataHash = keccak256(bytes.concat(bytes1(0x01), abi.encode(chainAdmin, assetId, transferData)));
bytes32 txDataHash = keccak256(
bytes.concat(NEW_ENCODING_VERSION, abi.encode(chainAdmin, assetId, transferData))
);
_setDepositHappened(gatewayChainId, merkleProofData.l2TxHash, txDataHash);

ConfirmTransferResultData memory transferResultData = _getConfirmTransferResultData(
Expand Down
Loading
Loading