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
c8192069
Commit
c8192069
authored
Dec 05, 2022
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add contract changes
parent
f573f06a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
5 deletions
+27
-5
MerkleTrie.sol
...contracts-bedrock/contracts/libraries/trie/MerkleTrie.sol
+2
-0
CommonTest.t.sol
packages/contracts-bedrock/contracts/test/CommonTest.t.sol
+19
-0
package.json
packages/contracts-bedrock/package.json
+6
-5
No files found.
packages/contracts-bedrock/contracts/libraries/trie/MerkleTrie.sol
View file @
c8192069
...
@@ -93,6 +93,8 @@ library MerkleTrie {
...
@@ -93,6 +93,8 @@ library MerkleTrie {
bytes[] memory _proof,
bytes[] memory _proof,
bytes32 _root
bytes32 _root
) internal pure returns (bytes memory) {
) internal pure returns (bytes memory) {
require(_key.length > 0, "MerkleTrie: empty key");
TrieNode[] memory proof = _parseProof(_proof);
TrieNode[] memory proof = _parseProof(_proof);
bytes memory key = Bytes.toNibbles(_key);
bytes memory key = Bytes.toNibbles(_key);
bytes memory currentNodeID = abi.encodePacked(_root);
bytes memory currentNodeID = abi.encodePacked(_root);
...
...
packages/contracts-bedrock/contracts/test/CommonTest.t.sol
View file @
c8192069
...
@@ -628,6 +628,25 @@ contract FFIInterface is Test {
...
@@ -628,6 +628,25 @@ contract FFIInterface is Test {
bytes memory result = vm.ffi(cmds);
bytes memory result = vm.ffi(cmds);
return abi.decode(result, (uint256, uint256));
return abi.decode(result, (uint256, uint256));
}
}
function getMerkleTrieFuzzCase(string memory variant)
external
returns (
bytes32,
bytes memory,
bytes memory,
bytes[] memory
)
{
string[] memory cmds = new string[](5);
cmds[0] = "./go-fuzz/fuzz";
cmds[1] = "-m";
cmds[2] = "trie";
cmds[3] = "-v";
cmds[4] = variant;
return abi.decode(vm.ffi(cmds), (bytes32, bytes, bytes, bytes[]));
}
}
}
// Used for testing a future upgrade beyond the current implementations.
// Used for testing a future upgrade beyond the current implementations.
...
...
packages/contracts-bedrock/package.json
View file @
c8192069
...
@@ -17,19 +17,20 @@
...
@@ -17,19 +17,20 @@
"build:forge"
:
"forge build"
,
"build:forge"
:
"forge build"
,
"build:with-metadata"
:
"FOUNDRY_PROFILE=echidna yarn build:forge"
,
"build:with-metadata"
:
"FOUNDRY_PROFILE=echidna yarn build:forge"
,
"build:differential"
:
"tsc scripts/differential-testing.ts --outDir dist --moduleResolution node --esModuleInterop"
,
"build:differential"
:
"tsc scripts/differential-testing.ts --outDir dist --moduleResolution node --esModuleInterop"
,
"build:fuzz"
:
"go build -o go-fuzz go-fuzz/cmd/fuzz.go"
,
"prebuild"
:
"yarn ts-node scripts/verify-foundry-install.ts"
,
"prebuild"
:
"yarn ts-node scripts/verify-foundry-install.ts"
,
"build"
:
"hardhat compile && yarn autogen:artifacts && yarn build:ts && yarn typechain"
,
"build"
:
"hardhat compile && yarn autogen:artifacts && yarn build:ts && yarn typechain"
,
"build:ts"
:
"tsc -p tsconfig.build.json"
,
"build:ts"
:
"tsc -p tsconfig.build.json"
,
"autogen:artifacts"
:
"ts-node scripts/generate-artifacts.ts"
,
"autogen:artifacts"
:
"ts-node scripts/generate-artifacts.ts"
,
"deploy"
:
"hardhat deploy"
,
"deploy"
:
"hardhat deploy"
,
"test"
:
"yarn build:differential && forge test"
,
"test"
:
"yarn build:differential &&
yarn build:fuzz &&
forge test"
,
"coverage"
:
"yarn build:differential && forge coverage"
,
"coverage"
:
"yarn build:differential &&
yarn build:fuzz &&
forge coverage"
,
"coverage:lcov"
:
"yarn build:differential && forge coverage --report lcov"
,
"coverage:lcov"
:
"yarn build:differential &&
yarn build:fuzz &&
forge coverage --report lcov"
,
"gas-snapshot"
:
"yarn build:differential && forge snapshot --no-match-test 'testDiff|testFuzz'"
,
"gas-snapshot"
:
"yarn build:differential &&
yarn build:fuzz &&
forge snapshot --no-match-test 'testDiff|testFuzz'"
,
"storage-snapshot"
:
"./scripts/storage-snapshot.sh"
,
"storage-snapshot"
:
"./scripts/storage-snapshot.sh"
,
"validate-spacers"
:
"hardhat validate-spacers"
,
"validate-spacers"
:
"hardhat validate-spacers"
,
"slither"
:
"./scripts/slither.sh"
,
"slither"
:
"./scripts/slither.sh"
,
"clean"
:
"rm -rf ./dist ./artifacts ./forge-artifacts ./cache ./tsconfig.tsbuildinfo ./src/contract-artifacts.ts"
,
"clean"
:
"rm -rf ./dist ./artifacts ./forge-artifacts ./cache ./tsconfig.tsbuildinfo ./src/contract-artifacts.ts
./go-fuzz/fuzz
"
,
"lint:ts:check"
:
"eslint . --max-warnings=0"
,
"lint:ts:check"
:
"eslint . --max-warnings=0"
,
"lint:forge-tests:check"
:
"ts-node scripts/forge-test-names.ts"
,
"lint:forge-tests:check"
:
"ts-node scripts/forge-test-names.ts"
,
"lint:contracts:check"
:
"yarn solhint -f table 'contracts/**/*.sol' && yarn lint:forge-tests:check"
,
"lint:contracts:check"
:
"yarn solhint -f table 'contracts/**/*.sol' && yarn lint:forge-tests:check"
,
...
...
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