-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add more tests * Add more by type tests * Run all ssz spec tests * Port full Lodestar types to SSZ * Update script runners * Fix unit tests * Add container tests * Test more empty List cases * Use ContainerType in validator perf tests * Add local copy of safeType
- Loading branch information
Showing
52 changed files
with
1,820 additions
and
633 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ yarn-error.log | |
.nyc_output/ | ||
.idea/ | ||
.vscode | ||
|
||
packages/ssz/spec-tests |
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 |
---|---|---|
|
@@ -7,4 +7,4 @@ node_modules/ | |
.vscode | ||
yarn-error.log | ||
|
||
test/spec-tests-data | ||
spec-tests |
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,41 @@ | ||
#!/bin/bash | ||
|
||
#################################################### | ||
# Copy all Lodestar eth2.0 types to SSZ's test files | ||
# | ||
# Why? | ||
# - To leverage consensus spec tests before release | ||
# - To ensure Lodestar's types definitions are compatible before releasing | ||
# - To benchmark usage a real eth2.0 types in SSZ for fast development | ||
#################################################### | ||
|
||
# Allow the script to be run from any folder and not break paths | ||
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
LODESTAR_EXECUTABLE=${SCRIPT_DIR}/../../packages/cli/bin/lodestar | ||
|
||
# Assumes your directory structure is: | ||
# i.e. you have cloned both the lodestar and ssz monorepo in the same parent directory | ||
# . | ||
# ├── lodestar | ||
# │ └── packages | ||
# │ └── types | ||
# └── ssz | ||
# └── packages | ||
# └── ssz | ||
# | ||
|
||
LODESTAR_TYPES_SRC=${SCRIPT_DIR}/../../../../lodestar/packages/types/src | ||
TYPES_SSZ_LOCATION=${SCRIPT_DIR}/lodestarTypes | ||
|
||
# Clean up existing directory | ||
rm -rf $TYPES_SSZ_LOCATION | ||
mkdir -p $TYPES_SSZ_LOCATION | ||
|
||
# Copy from lodestar types the entire source | ||
cp -R $LODESTAR_TYPES_SRC/. $TYPES_SSZ_LOCATION | ||
|
||
# Replace imports | ||
find $TYPES_SSZ_LOCATION \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/@chainsafe\/ssz/\.\.\/\.\.\/\.\.\/src/g' | ||
|
||
|
||
|
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,2 @@ | ||
export * as ts from "./types"; | ||
export * as ssz from "./sszTypes"; |
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
13 changes: 7 additions & 6 deletions
13
packages/ssz/test/lodestar/allForks/types.ts → .../ssz/test/lodestarTypes/allForks/types.ts
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,2 @@ | ||
export * as ts from "./types"; | ||
export * as ssz from "./sszTypes"; |
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
Oops, something went wrong.