Skip to content

Commit

Permalink
(fix): small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Raid Ateir committed Sep 18, 2024
1 parent bb6d780 commit de8ed4c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 52 deletions.
3 changes: 1 addition & 2 deletions l1-contracts/contracts/bridge/ntv/L1NativeTokenVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,11 @@ contract L1NativeTokenVault is IL1NativeTokenVault, IL1AssetHandler, NativeToken
}

/// @notice Used to register the Asset Handler asset in L2 AssetRouter.
/// @param _originalCaller the address that called the Router
/// @param _assetHandlerAddressOnCounterpart the address of the asset handler on the counterpart chain.
function bridgeCheckCounterpartAddress(
uint256,
bytes32,
address _originalCaller,
address,
address _assetHandlerAddressOnCounterpart
) external view override onlyAssetRouter {
require(_assetHandlerAddressOnCounterpart == L2_NATIVE_TOKEN_VAULT_ADDR, "NTV: wrong counterpart");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import {console} from "forge-std/console.sol";

import {Test} from "forge-std/Test.sol";

Expand Down Expand Up @@ -116,13 +115,13 @@ contract ExecutorProofTest is Test {
);
assertEq(
nextCommitment,
0xeea98956005a2cdd17238f07c49319c87a8f19a1df358f4657c1f52775095deb,
0x81e46ea22cdb4a0a6cb30b6c02170394703e9bdd101275d542a7c6c23c789898,
"nextCommitment computation failed"
);

bytes32 prevCommitment = 0x6ebf945305689a8c3ac993df7f002d41d311a762cd6bf39bb054ead8d1f54404;
uint256 result = executor.getBatchProofPublicInput(prevCommitment, nextCommitment);
assertEq(result, 0xCDA3D9E16BB6624ABAC7E57CA069850BC601AB347982457929623FFD, "getBatchProofPublicInput");
assertEq(result, 0x7C854720CBA105B9E34DA6A28770B93AD384C1BF98C497CCBFA4DADB, "getBatchProofPublicInput");
}

// add this to be excluded from coverage report
Expand Down
43 changes: 3 additions & 40 deletions l1-contracts/test/foundry/l1/unit/concrete/Utils/Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -109,52 +109,15 @@ library Utils {
}

function createSystemLogsWithEmptyDAValidator(bytes32 _outputHash) public returns (bytes[] memory) {
bytes[] memory logs = new bytes[](7);
logs[0] = constructL2Log(
true,
L2_TO_L1_MESSENGER,
uint256(SystemLogKey.L2_TO_L1_LOGS_TREE_ROOT_KEY),
bytes32("")
);
logs[1] = constructL2Log(
true,
L2_SYSTEM_CONTEXT_ADDRESS,
uint256(SystemLogKey.PACKED_BATCH_AND_L2_BLOCK_TIMESTAMP_KEY),
bytes32("")
);
logs[2] = constructL2Log(
true,
L2_SYSTEM_CONTEXT_ADDRESS,
uint256(SystemLogKey.PREV_BATCH_HASH_KEY),
bytes32("")
);
logs[3] = constructL2Log(
true,
L2_BOOTLOADER_ADDRESS,
uint256(SystemLogKey.CHAINED_PRIORITY_TXN_HASH_KEY),
keccak256("")
);
logs[4] = constructL2Log(
true,
L2_BOOTLOADER_ADDRESS,
uint256(SystemLogKey.NUMBER_OF_LAYER_1_TXS_KEY),
bytes32("")
);

logs[5] = constructL2Log(
true,
L2_TO_L1_MESSENGER,
uint256(SystemLogKey.L2_DA_VALIDATOR_OUTPUT_HASH_KEY),
_outputHash
);
logs[6] = constructL2Log(
bytes[] memory systemLogs = createSystemLogs(bytes32(0));
systemLogs[6] = constructL2Log(
true,
L2_TO_L1_MESSENGER,
uint256(SystemLogKey.USED_L2_DA_VALIDATOR_ADDRESS_KEY),
bytes32(uint256(0))
);

return logs;
return systemLogs;
}

function createSystemLogsWithUpgradeTransaction(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ contract ChainTypeManagerTest is Test {
Diamond.FacetCut[] internal facetCuts;

function deploy() public {
// constructor(
// address _l1WethAddress,
// address _bridgehub,
// address _l1Nullifier,
// uint256 _eraChainId,
// address _eraDiamondProxy
// )
bridgehub = new Bridgehub(block.chainid, governor, type(uint256).max);
newChainAdmin = makeAddr("chainadmin");

Expand Down

0 comments on commit de8ed4c

Please sign in to comment.