diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e158a44..762a296 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,7 +39,7 @@ jobs: forge build --sizes id: build - # - name: Run Forge tests - # run: | - # forge test -vvv - # id: test + - name: Run Forge tests + run: | + forge test -vvv + id: test diff --git a/src/Part1_Counter.sol b/src/Part1_Counter.sol index cc2ee5a..c996b51 100644 --- a/src/Part1_Counter.sol +++ b/src/Part1_Counter.sol @@ -28,6 +28,8 @@ contract CounterReader { /// @notice Reads `number` and `map[123]` from L1 using L1SLOAD /// @dev This function reads values from L1 function readCounter() external view returns (uint256, uint256) { - // TODO: complete this function + bytes32 mappingSlot = keccak256(abi.encode( /* mapping key: */ 123, /* mapping slot: */ 1)); + (uint256 val0, uint256 val1) = L1SLOAD.readUint256(counter, bytes32(uint256(0)), mappingSlot); + return (val0, val1); } } diff --git a/src/Part3_Keystore.sol b/src/Part3_Keystore.sol index 0d58b5d..856c3be 100644 --- a/src/Part3_Keystore.sol +++ b/src/Part3_Keystore.sol @@ -60,6 +60,8 @@ contract L2Wallet is Wallet { /// @inheritdoc Wallet /// @dev This function reads the signer value from L1 function isAuthorized(address signer) public view override returns (bool) { - // TODO: complete this function + bytes32 mappingSlot = keccak256(abi.encode( /* mapping key: */ signer, /* mapping slot: */ 0)); + bool authorized = L1SLOAD.readBool(l1Wallet, mappingSlot); + return authorized; } }