-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c2002d
commit 020c402
Showing
7 changed files
with
129 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity 0.8.0; | ||
|
||
contract Utils { | ||
function test_HashPairShouldNeverRevert() external { | ||
// It should never revert. | ||
} | ||
|
||
function test_HashPairWhenFirstArgIsSmallerThanSecondArg() external { | ||
// It should match the result of `keccak256(abi.encodePacked(a,b))`. | ||
} | ||
|
||
function test_HashPairWhenFirstArgIsBiggerThanSecondArg() external { | ||
// It should match the result of `keccak256(abi.encodePacked(b,a))`. | ||
} | ||
|
||
function test_MinShouldNeverRevert() external { | ||
// It should never revert. | ||
} | ||
|
||
function test_MinWhenFirstArgIsSmallerThanSecondArg() external { | ||
// It should match the value of `a`. | ||
} | ||
|
||
function test_MinWhenFirstArgIsBiggerThanSecondArg() external { | ||
// It should match the value of `b`. | ||
} | ||
|
||
function test_MaxShouldNeverRevert() external { | ||
// It should never revert. | ||
} | ||
|
||
function test_MaxWhenFirstArgIsSmallerThanSecondArg() external { | ||
// It should match the value of `b`. | ||
} | ||
|
||
function test_MaxWhenFirstArgIsBiggerThanSecondArg() external { | ||
// It should match the value of `a`. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Utils::hashPair | ||
├── It should never revert. | ||
├── When first arg is smaller than second arg | ||
│ └── It should match the result of `keccak256(abi.encodePacked(a,b))`. | ||
└── When first arg is bigger than second arg | ||
└── It should match the result of `keccak256(abi.encodePacked(b,a))`. | ||
|
||
|
||
Utils::min | ||
├── It should never revert. | ||
├── When first arg is smaller than second arg | ||
│ └── It should match the value of `a`. | ||
└── When first arg is bigger than second arg | ||
└── It should match the value of `b`. | ||
|
||
|
||
Utils::max | ||
├── It should never revert. | ||
├── When first arg is smaller than second arg | ||
│ └── It should match the value of `b`. | ||
└── When first arg is bigger than second arg | ||
└── It should match the value of `a`. |