Skip to content
This repository has been archived by the owner on Jan 31, 2025. It is now read-only.

Commit

Permalink
test: remove unnecessary unchecked blocks
Browse files Browse the repository at this point in the history
test: undo changes in Murky.sol
  • Loading branch information
andreivladbrg committed Jan 6, 2024
1 parent 726223c commit f05633f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
4 changes: 1 addition & 3 deletions test/utils/ArrayBuilder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ library ArrayBuilder {
{
streamIds = new uint256[](batchSize);
for (uint256 i = 0; i < batchSize; ++i) {
unchecked {
streamIds[i] = firstStreamId + i;
}
streamIds[i] = firstStreamId + i;
}
}
}
16 changes: 4 additions & 12 deletions test/utils/BatchBuilder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ library BatchBuilder {
{
batch = new Batch.CreateWithDeltas[](batchSize);
for (uint256 i = 0; i < batchSize; ++i) {
unchecked {
batch[i] = batchSingle;
}
batch[i] = batchSingle;
}
}

Expand Down Expand Up @@ -56,9 +54,7 @@ library BatchBuilder {
{
batch = new Batch.CreateWithDurations[](batchSize);
for (uint256 i = 0; i < batchSize; ++i) {
unchecked {
batch[i] = batchSingle;
}
batch[i] = batchSingle;
}
}

Expand Down Expand Up @@ -95,9 +91,7 @@ library BatchBuilder {
{
batch = new Batch.CreateWithMilestones[](batchSize);
for (uint256 i = 0; i < batchSize; ++i) {
unchecked {
batch[i] = batchSingle;
}
batch[i] = batchSingle;
}
}

Expand Down Expand Up @@ -135,9 +129,7 @@ library BatchBuilder {
{
batch = new Batch.CreateWithRange[](batchSize);
for (uint256 i = 0; i < batchSize; ++i) {
unchecked {
batch[i] = batchSingle;
}
batch[i] = batchSingle;
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/utils/Murky.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ abstract contract MurkyBase {
// proof length must be less than max array size
bytes32 rollingHash = valueToProve;
uint256 length = proof.length;
for (uint256 i = 0; i < length; ++i) {
unchecked {
unchecked {
for (uint256 i = 0; i < length; ++i) {
rollingHash = hashLeafPairs(rollingHash, proof[i]);
}
}
Expand Down

0 comments on commit f05633f

Please sign in to comment.