Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
de31de92
Commit
de31de92
authored
Jun 01, 2023
by
Ratimon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chore & Doc: Linting and Generating doc
parent
e43bfbe4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
Hashing.t.sol
...contracts-bedrock/contracts/test/invariants/Hashing.t.sol
+2
-7
Hashing.md
packages/contracts-bedrock/invariant-docs/Hashing.md
+18
-0
No files found.
packages/contracts-bedrock/contracts/test/invariants/Hashing.t.sol
View file @
de31de92
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
import {
Test
} from "forge-std/Test.sol";
import {
StdInvariant
} from "forge-std/StdInvariant.sol";
import {
Test
} from "forge-std/Test.sol";
import {
StdInvariant
} from "forge-std/StdInvariant.sol";
import { Encoding } from "../../libraries/Encoding.sol";
import { Hashing } from "../../libraries/Hashing.sol";
...
...
@@ -114,9 +114,6 @@ contract Hash_CrossDomainHasher {
failedCrossDomainHashV1 = true;
}
}
}
contract Hashing_Invariant is StdInvariant, Test {
...
...
@@ -172,5 +169,3 @@ contract Hashing_Invariant is StdInvariant, Test {
assertEq(actor.failedCrossDomainHashV1(), false);
}
}
packages/contracts-bedrock/invariant-docs/Hashing.md
View file @
de31de92
# `Hashing` Invariants
## `hashCrossDomainMessage` reverts if `version` is > `1`.
**Test:**
[
`Hashing.t.sol#L141`
](
../contracts/test/invariants/Hashing.t.sol#L141
)
The
`hashCrossDomainMessage`
function should always revert if the
`version`
passed is >
`1`
.
## `version` = `0`: `hashCrossDomainMessage` and `hashCrossDomainMessageV0` are equivalent.
**Test:**
[
`Hashing.t.sol#L153`
](
../contracts/test/invariants/Hashing.t.sol#L153
)
If the version passed is 0,
`hashCrossDomainMessage`
and
`hashCrossDomainMessageV0`
should be equivalent.
## `version` = `1`: `hashCrossDomainMessage` and `hashCrossDomainMessageV1` are equivalent.
**Test:**
[
`Hashing.t.sol#L166`
](
../contracts/test/invariants/Hashing.t.sol#L166
)
If the version passed is 1,
`hashCrossDomainMessage`
and
`hashCrossDomainMessageV1`
should be equivalent.
## `hashCrossDomainMessage` reverts if `version` is > `1`.
**Test:**
[
`FuzzHashing.sol#L120`
](
../contracts/echidna/FuzzHashing.sol#L120
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment