Commit 67d3a32e authored by Maurelian's avatar Maurelian Committed by GitHub

Merge pull request #8605 from ethereum-optimism/rename-auth-test-file

contracts-bedrock: Rename Authorization.t.sol to Specs.t.sol
parents e6e7fd26 f5d1ba0f
...@@ -8,14 +8,13 @@ import { ProtocolVersions } from "src/L1/ProtocolVersions.sol"; ...@@ -8,14 +8,13 @@ import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { OptimismPortal } from "src/L1/OptimismPortal.sol"; import { OptimismPortal } from "src/L1/OptimismPortal.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol"; import { SystemConfig } from "src/L1/SystemConfig.sol";
/// @title Authorization_Test /// @title Specification_Test
/// @dev Specify access requirements of all entrypoints to L1 contracts. /// @dev Specifies common security properties of entrypoints to L1 contracts, including authorization and
/// When adding new functions, make sure to update the `setUp` function to document if /// pausability.
/// the function should be authorized or not. The `Spec` struct reppresents this /// When adding new functions to the L1 system, the `setUp` function must be updated to document the security
/// documentation, where `auth` is `true` if the function requires authorization and /// properties of the new function. The `Spec` struct reppresents this documentation. However, this contract does
/// `false` otherwise. However, this contract does not test for authorization, only that /// not actually test to verify these properties, only that a spec is defined.
/// an auth spec is defined for every L1 function. contract Specification_Test is CommonTest {
contract Authorization_Test is CommonTest {
struct AbiEntry { struct AbiEntry {
string fnName; string fnName;
bytes4 sel; bytes4 sel;
...@@ -451,7 +450,7 @@ contract Authorization_Test is CommonTest { ...@@ -451,7 +450,7 @@ contract Authorization_Test is CommonTest {
for (uint256 i = 0; i < abis.length; i++) { for (uint256 i = 0; i < abis.length; i++) {
string memory contractName = abis[i].contractName; string memory contractName = abis[i].contractName;
assertEq( assertEq(
abis[i].entries.length, numEntries[contractName], "Authorization_Test: invalid number of ABI entries" abis[i].entries.length, numEntries[contractName], "Specification_Test: invalid number of ABI entries"
); );
for (uint256 j = 0; j < abis[i].entries.length; j++) { for (uint256 j = 0; j < abis[i].entries.length; j++) {
...@@ -460,8 +459,8 @@ contract Authorization_Test is CommonTest { ...@@ -460,8 +459,8 @@ contract Authorization_Test is CommonTest {
"Checking auth spec for %s: %s(%x)", contractName, abiEntry.fnName, uint256(uint32(abiEntry.sel)) "Checking auth spec for %s: %s(%x)", contractName, abiEntry.fnName, uint256(uint32(abiEntry.sel))
); );
Spec memory spec = specs[contractName][abiEntry.sel]; Spec memory spec = specs[contractName][abiEntry.sel];
assertTrue(spec.sel != bytes4(0), "Authorization_Test: missing spec definition"); assertTrue(spec.sel != bytes4(0), "Specification_Test: missing spec definition");
assertEq(abiEntry.sel, spec.sel, "Authorization_Test: invalid ABI"); assertEq(abiEntry.sel, spec.sel, "Specification_Test: invalid ABI");
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment