Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use v5.3.0 slashing interchange test vectors #5640

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions tests/slashing_protection/test_fixtures.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
{.used.}

import
# Standard library
std/os,
# Status lib
stew/[results, byteutils],
stew/results,
chronicles,
# Internal
../../beacon_chain/validators/[slashing_protection, slashing_protection_v2],
Expand All @@ -20,6 +18,9 @@ import
../testutil, ../testdbutil,
../consensus_spec/fixtures_utils

from std/os import changeFileExt, removeFile, walkDir, `/`
from stew/byteutils import toHex

type
TestInterchange = object
name: string
Expand Down Expand Up @@ -55,13 +56,15 @@ type
slot: SlotString
signing_root: Eth2Digest0x
should_succeed: bool
should_succeed_complete: bool

CandidateVote = object
pubkey: PubKey0x
source_epoch: EpochString
target_epoch: EpochString
signing_root: Eth2Digest0x
should_succeed: bool
should_succeed_complete: bool

func toHexLogs(v: CandidateBlock): auto =
(
Expand All @@ -87,7 +90,7 @@ proc sqlite3db_delete(basepath, dbname: string) =
removeFile(basepath / dbname&".sqlite3-wal")
removeFile(basepath / dbname&".sqlite3")

const InterchangeTestsDir = FixturesDir / "tests-slashing-v5.2.1" / "tests" / "generated"
const InterchangeTestsDir = FixturesDir / "tests-slashing-v5.3.0" / "tests" / "generated"
const TestDir = ""
const TestDbPrefix = "test_slashprot_"

Expand Down
2 changes: 1 addition & 1 deletion vendor/nim-eth2-scenarios