-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tests] SHA256 + official shuffling vectors (#263)
* Change digests to SHA2-256 (from Keccak256) * Fix sha256 digest initialization - pass shuffling test * Add comments + remove old shuffling tests * Remove stale tree hashing tests * Small toOpenArray optim + notes on in-place hashing * Revert "Revert "Update test repo"" This reverts commit f385467. * Revert "Revert "Fix SIGFPE on shuffling for 0"" This reverts commit 226d380. * Revert "Revert "Implement shuffling test (pending typedesc and shuffling algo fix)"" This reverts commit 813cb6f. * withEth2hash templates now needs ctx.init() * Use init-update-finish to avoid burnMem
- Loading branch information
Showing
10 changed files
with
131 additions
and
121 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
Submodule fixtures
updated
from da49e6 to 80c365
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,30 @@ | ||
# beacon_chain | ||
# Copyright (c) 2018 Status Research & Development GmbH | ||
# Licensed and distributed under either of | ||
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT). | ||
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0). | ||
# at your option. This file may not be copied, modified, or distributed except according to those terms. | ||
|
||
import | ||
# Standard libs | ||
ospaths, strutils, json, unittest, | ||
# Third parties | ||
|
||
# Beacon chain internals | ||
../../beacon_chain/spec/validator, | ||
# Test utilities | ||
./fixtures_utils | ||
|
||
const TestFolder = currentSourcePath.rsplit(DirSep, 1)[0] | ||
const TestsPath = "fixtures" / "json_tests" / "shuffling" / "core" / "shuffling_full.json" | ||
|
||
var shufflingTests: ShufflingTests | ||
|
||
suite "Official - Shuffling tests": | ||
test "Parsing the official shuffling tests": | ||
shufflingTests = parseTests(TestFolder / TestsPath) | ||
|
||
test "Shuffling a sequence of N validators": | ||
for t in shufflingTests.test_cases: | ||
let implResult = get_shuffled_seq(t.seed, t.count) | ||
check: implResult == t.shuffled |
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
Oops, something went wrong.