From d9e7b753b4d2307259a0cb7e9a9363649d526a50 Mon Sep 17 00:00:00 2001 From: Mark Tyneway Date: Mon, 26 Jun 2023 13:49:04 -0700 Subject: [PATCH 1/2] contracts-bedrock: lint lib position tests Typo in succeeds --- .../contracts/test/LibPosition.t.sol | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/contracts-bedrock/contracts/test/LibPosition.t.sol b/packages/contracts-bedrock/contracts/test/LibPosition.t.sol index aaaa3e6cb9db..816e54527512 100644 --- a/packages/contracts-bedrock/contracts/test/LibPosition.t.sol +++ b/packages/contracts-bedrock/contracts/test/LibPosition.t.sol @@ -22,7 +22,7 @@ contract LibPosition_Test is Test { } /// @notice Tests that the `depth` function correctly shifts out the `depth` from a packed `Position` type. - function testFuzz_depth_correctness_suceeds(uint8 _depth, uint64 _indexAtDepth) public { + function testFuzz_depth_correctness_succeeds(uint8 _depth, uint64 _indexAtDepth) public { _depth = uint8(bound(_depth, 0, MAX_DEPTH)); _indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth); Position position = LibPosition.wrap(_depth, _indexAtDepth); @@ -30,7 +30,7 @@ contract LibPosition_Test is Test { } /// @notice Tests that the `indexAtDepth` function correctly shifts out the `indexAtDepth` from a packed `Position` type. - function testFuzz_indexAtDepth_correctness_suceeds(uint8 _depth, uint64 _indexAtDepth) public { + function testFuzz_indexAtDepth_correctness_succeeds(uint8 _depth, uint64 _indexAtDepth) public { _depth = uint8(bound(_depth, 0, MAX_DEPTH)); _indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth); Position position = LibPosition.wrap(_depth, _indexAtDepth); @@ -38,7 +38,7 @@ contract LibPosition_Test is Test { } /// @notice Tests that the `left` function correctly computes the position of the left child. - function testFuzz_left_correctness_suceeds(uint8 _depth, uint64 _indexAtDepth) public { + function testFuzz_left_correctness_succeeds(uint8 _depth, uint64 _indexAtDepth) public { _depth = uint8(bound(_depth, 0, MAX_DEPTH)); _indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth); @@ -50,7 +50,7 @@ contract LibPosition_Test is Test { } /// @notice Tests that the `right` function correctly computes the position of the right child. - function testFuzz_right_correctness_suceeds(uint8 _depth, uint64 _indexAtDepth) public { + function testFuzz_right_correctness_succeeds(uint8 _depth, uint64 _indexAtDepth) public { // Depth bound: [0, 63] _depth = uint8(bound(_depth, 0, MAX_DEPTH)); _indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth); @@ -63,7 +63,7 @@ contract LibPosition_Test is Test { } /// @notice Tests that the `parent` function correctly computes the position of the parent. - function testFuzz_parent_correctness_suceeds(uint8 _depth, uint64 _indexAtDepth) public { + function testFuzz_parent_correctness_succeeds(uint8 _depth, uint64 _indexAtDepth) public { _depth = uint8(bound(_depth, 1, MAX_DEPTH)); _indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth); @@ -76,7 +76,7 @@ contract LibPosition_Test is Test { /// @notice Tests that the `rightIndex` function correctly computes the deepest, right most index relative /// to a given position. - function testFuzz_rightIndex_correctness_suceeds( + function testFuzz_rightIndex_correctness_succeeds( uint64 _maxDepth, uint8 _depth, uint64 _indexAtDepth @@ -102,7 +102,7 @@ contract LibPosition_Test is Test { /// @notice Tests that the `attack` function correctly computes the position of the attack relative to /// a given position. /// @dev `attack` is an alias for `left`, but we test it separately for completeness. - function testFuzz_attack_correctness_suceeds(uint8 _depth, uint64 _indexAtDepth) public { + function testFuzz_attack_correctness_succeeds(uint8 _depth, uint64 _indexAtDepth) public { // Depth bound: [0, 63] _depth = uint8(bound(_depth, 0, MAX_DEPTH)); _indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth); @@ -118,7 +118,7 @@ contract LibPosition_Test is Test { /// a given position. /// @dev A defense can only be given if the position does not belong to the root claim, hence the bound of [1, 127] /// on the depth. - function testFuzz_defend_correctness_suceeds(uint8 _depth, uint64 _indexAtDepth) public { + function testFuzz_defend_correctness_succeeds(uint8 _depth, uint64 _indexAtDepth) public { // Depth bound: [1, 63] _depth = uint8(bound(_depth, 1, MAX_DEPTH)); _indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth); From cbdbd8ee8c5ce8356a0e11fb165369727e78ac9d Mon Sep 17 00:00:00 2001 From: Andreas Bigger Date: Mon, 26 Jun 2023 17:08:09 -0400 Subject: [PATCH 2/2] Add gas snapshot --- packages/contracts-bedrock/.gas-snapshot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contracts-bedrock/.gas-snapshot b/packages/contracts-bedrock/.gas-snapshot index 2ac226c66758..a35eb438e8ae 100644 --- a/packages/contracts-bedrock/.gas-snapshot +++ b/packages/contracts-bedrock/.gas-snapshot @@ -230,7 +230,7 @@ LegacyERC20ETH_Test:test_mint_doesNotExist_reverts() (gas: 10627) LegacyERC20ETH_Test:test_transferFrom_doesNotExist_reverts() (gas: 12957) LegacyERC20ETH_Test:test_transfer_doesNotExist_reverts() (gas: 10755) LegacyMessagePasser_Test:test_passMessageToL1_succeeds() (gas: 34524) -LibPosition_Test:test_pos_correctness_succeeds() (gas: 38711) +LibPosition_Test:test_pos_correctness_succeeds() (gas: 38689) MerkleTrie_get_Test:test_get_corruptedProof_reverts() (gas: 5736) MerkleTrie_get_Test:test_get_extraProofElements_reverts() (gas: 58975) MerkleTrie_get_Test:test_get_invalidDataRemainder_reverts() (gas: 35852)