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
00250cb2
Commit
00250cb2
authored
Oct 24, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
@maurelian review
parent
e07b48c9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
README.md
packages/contracts-bedrock/scripts/go-ffi/README.md
+18
-0
differential-testing.go
.../contracts-bedrock/scripts/go-ffi/differential-testing.go
+2
-1
No files found.
packages/contracts-bedrock/scripts/go-ffi/README.md
View file @
00250cb2
...
...
@@ -13,8 +13,26 @@ A lightweight binary for utilities accessed via `forge`'s `ffi` cheatcode in the
To build, run
`pnpm build:go-ffi`
from this directory or the
`contract-bedrock`
package.
### In a Forge Test
To use
`go-ffi`
in a forge test, simply invoke the binary via the
`vm.ffi`
cheatcode.
```
solidity
function myFFITest() public {
string[] memory commands = new string[](3);
commands[0] = "./scripts/go-ffi/go-ffi";
commands[1] = "trie";
commands[2] = "valid";
bytes memory result = vm.ffi(commands);
// Do something with the result of the command
}
```
### Available Modes
There are two modes available in
`go-ffi`
:
`diff`
and
`trie`
. Each are present as a subcommand to the
`go-ffi`
binary, with their own set of variants.
#### `diff`
> **Note**
...
...
packages/contracts-bedrock/scripts/go-ffi/differential-testing.go
View file @
00250cb2
...
...
@@ -76,13 +76,14 @@ var (
func
DiffTestUtils
()
{
args
:=
os
.
Args
[
2
:
]
variant
:=
args
[
0
]
// This command requires arguments
if
len
(
args
)
==
0
{
panic
(
"Error: No arguments provided"
)
}
switch
args
[
0
]
{
switch
variant
{
case
"decodeVersionedNonce"
:
// Parse input arguments
input
,
ok
:=
new
(
big
.
Int
)
.
SetString
(
args
[
1
],
10
)
...
...
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