fix relative import paths for Nim 2.0 (#5397)

In Nim 2.0, relative `import` paths are validated more strictly;
this fixes the incorrect paths used in some tests.
This commit is contained in:
Etan Kissling 2023-09-06 10:17:59 +02:00 committed by GitHub
parent ac3b2b4233
commit 81397342d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 33 additions and 33 deletions

View File

@ -9,8 +9,8 @@
import import
# Beacon chain internals # Beacon chain internals
../../beacon_chain/spec/[beaconstate, validator, helpers, state_transition_epoch], ../../../beacon_chain/spec/[beaconstate, validator, helpers, state_transition_epoch],
../../beacon_chain/spec/datatypes/altair, ../../../beacon_chain/spec/datatypes/altair,
# Test utilities # Test utilities
../../testutil, ../../testutil,
../fixtures_utils, ../os_ops ../fixtures_utils, ../os_ops

View File

@ -14,7 +14,7 @@ import
# Third-party # Third-party
yaml, yaml,
# Beacon chain internals # Beacon chain internals
../../beacon_chain/spec/datatypes/altair, ../../../beacon_chain/spec/datatypes/altair,
# Status libraries # Status libraries
snappy, snappy,
# Test utilities # Test utilities

View File

@ -9,8 +9,8 @@
import import
# Beacon chain internals # Beacon chain internals
../../beacon_chain/spec/[beaconstate, validator, helpers, state_transition_epoch], ../../../beacon_chain/spec/[beaconstate, validator, helpers, state_transition_epoch],
../../beacon_chain/spec/datatypes/[altair, bellatrix], ../../../beacon_chain/spec/datatypes/[altair, bellatrix],
# Test utilities # Test utilities
../../testutil, ../../testutil,
../fixtures_utils, ../os_ops ../fixtures_utils, ../os_ops

View File

@ -11,7 +11,7 @@ import
# Third-party # Third-party
yaml, yaml,
# Beacon chain internals # Beacon chain internals
../../beacon_chain/spec/datatypes/[altair, bellatrix], ../../../beacon_chain/spec/datatypes/[altair, bellatrix],
# Status libraries # Status libraries
snappy, snappy,
# Test utilities # Test utilities

View File

@ -9,8 +9,8 @@
import import
# Beacon chain internals # Beacon chain internals
../../beacon_chain/spec/[beaconstate, validator, helpers, state_transition_epoch], ../../../beacon_chain/spec/[beaconstate, validator, helpers, state_transition_epoch],
../../beacon_chain/spec/datatypes/[altair, capella], ../../../beacon_chain/spec/datatypes/[altair, capella],
# Test utilities # Test utilities
../../testutil, ../../testutil,
../fixtures_utils, ../os_ops ../fixtures_utils, ../os_ops

View File

@ -14,13 +14,13 @@ import
# Third-party # Third-party
yaml, yaml,
# Beacon chain internals # Beacon chain internals
../../beacon_chain/spec/datatypes/[altair, capella], ../../../beacon_chain/spec/datatypes/[altair, capella],
# Status libraries # Status libraries
snappy, snappy,
# Test utilities # Test utilities
../../testutil, ../fixtures_utils, ../os_ops ../../testutil, ../fixtures_utils, ../os_ops
from ../../beacon_chain/spec/datatypes/bellatrix import PowBlock from ../../../beacon_chain/spec/datatypes/bellatrix import PowBlock
# SSZ tests of consensus objects (minimal/mainnet preset specific) # SSZ tests of consensus objects (minimal/mainnet preset specific)

View File

@ -9,8 +9,8 @@
import import
# Beacon chain internals # Beacon chain internals
../../beacon_chain/spec/[beaconstate, validator, helpers, state_transition_epoch], ../../../beacon_chain/spec/[beaconstate, validator, helpers, state_transition_epoch],
../../beacon_chain/spec/datatypes/[altair, deneb], ../../../beacon_chain/spec/datatypes/[altair, deneb],
# Test utilities # Test utilities
../../testutil, ../../testutil,
../fixtures_utils, ../os_ops ../fixtures_utils, ../os_ops

View File

@ -14,14 +14,14 @@ import
# Third-party # Third-party
yaml, yaml,
# Beacon chain internals # Beacon chain internals
../../beacon_chain/spec/datatypes/[altair, deneb], ../../../beacon_chain/spec/datatypes/[altair, deneb],
# Status libraries # Status libraries
snappy, snappy,
# Test utilities # Test utilities
../../testutil, ../fixtures_utils, ../os_ops ../../testutil, ../fixtures_utils, ../os_ops
from ../../beacon_chain/spec/datatypes/bellatrix import PowBlock from ../../../beacon_chain/spec/datatypes/bellatrix import PowBlock
from ../../beacon_chain/spec/datatypes/capella import from ../../../beacon_chain/spec/datatypes/capella import
BLSToExecutionChange, SignedBLSToExecutionChange, HistoricalSummary, BLSToExecutionChange, SignedBLSToExecutionChange, HistoricalSummary,
Withdrawal Withdrawal

View File

@ -10,8 +10,8 @@
import import
# Standard library # Standard library
# Beacon chain internals # Beacon chain internals
../../beacon_chain/spec/[validator, helpers, state_transition_epoch], ../../../beacon_chain/spec/[validator, helpers, state_transition_epoch],
../../beacon_chain/spec/datatypes/phase0, ../../../beacon_chain/spec/datatypes/phase0,
# Test utilities # Test utilities
../../testutil, ../../testutil,
../fixtures_utils, ../os_ops ../fixtures_utils, ../os_ops

View File

@ -1,5 +1,5 @@
# beacon_chain # beacon_chain
# Copyright (c) 2018-2022 Status Research & Development GmbH # Copyright (c) 2018-2023 Status Research & Development GmbH
# Licensed and distributed under either of # Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -14,7 +14,7 @@ import
# Third-party # Third-party
yaml, yaml,
# Beacon chain internals # Beacon chain internals
../../beacon_chain/spec/datatypes/phase0, ../../../beacon_chain/spec/datatypes/phase0,
# Status libraries # Status libraries
snappy, snappy,
# Test utilities # Test utilities

View File

@ -15,7 +15,7 @@ import
# Third-party # Third-party
yaml, yaml,
# Beacon chain internals # Beacon chain internals
../../../beacon_chain/spec/helpers, ../../beacon_chain/spec/helpers,
# Test utilities # Test utilities
../testutil, ../testutil,
./fixtures_utils, ./os_ops ./fixtures_utils, ./os_ops

View File

@ -15,7 +15,7 @@ import
# Third-party # Third-party
yaml, yaml,
# Beacon chain internals # Beacon chain internals
../../../beacon_chain/spec/[forks, light_client_sync], ../../beacon_chain/spec/[forks, light_client_sync],
# Test utilities # Test utilities
../testutil, ../testutil,
./fixtures_utils, ./os_ops ./fixtures_utils, ./os_ops

View File

@ -15,7 +15,7 @@ import
# Third-party # Third-party
yaml, yaml,
# Beacon chain internals # Beacon chain internals
../../../beacon_chain/spec/helpers, ../../beacon_chain/spec/helpers,
# Test utilities # Test utilities
../testutil, ../testutil,
./fixtures_utils, ./os_ops ./fixtures_utils, ./os_ops

View File

@ -15,9 +15,9 @@ import
../testutil ../testutil
from std/sequtils import toSeq from std/sequtils import toSeq
from ../../../beacon_chain/spec/forks import from ../../beacon_chain/spec/forks import
ForkedEpochInfo, ForkedHashedBeaconState, fromSszBytes, getStateRoot, new ForkedEpochInfo, ForkedHashedBeaconState, fromSszBytes, getStateRoot, new
from ../../../beacon_chain/spec/presets import from ../../beacon_chain/spec/presets import
const_preset, defaultRuntimeConfig const_preset, defaultRuntimeConfig
from ./fixtures_utils import from ./fixtures_utils import
SSZ, SszTestsDir, hash_tree_root, parseTest, readSszBytes, toSszType SSZ, SszTestsDir, hash_tree_root, parseTest, readSszBytes, toSszType
@ -92,22 +92,22 @@ template runForkBlockTests(
runForkBlockTests( runForkBlockTests(
"phase0", "Phase 0", phase0.BeaconState, phase0.SignedBeaconBlock) "phase0", "Phase 0", phase0.BeaconState, phase0.SignedBeaconBlock)
from ../../../beacon_chain/spec/datatypes/altair import from ../../beacon_chain/spec/datatypes/altair import
BeaconState, SignedBeaconBlock BeaconState, SignedBeaconBlock
runForkBlockTests( runForkBlockTests(
"altair", "Altair", altair.BeaconState, altair.SignedBeaconBlock) "altair", "Altair", altair.BeaconState, altair.SignedBeaconBlock)
from ../../../beacon_chain/spec/datatypes/bellatrix import from ../../beacon_chain/spec/datatypes/bellatrix import
BeaconState, SignedBeaconBlock BeaconState, SignedBeaconBlock
runForkBlockTests( runForkBlockTests(
"bellatrix", "Bellatrix", bellatrix.BeaconState, bellatrix.SignedBeaconBlock) "bellatrix", "Bellatrix", bellatrix.BeaconState, bellatrix.SignedBeaconBlock)
from ../../../beacon_chain/spec/datatypes/capella import from ../../beacon_chain/spec/datatypes/capella import
BeaconState, SignedBeaconBlock BeaconState, SignedBeaconBlock
runForkBlockTests( runForkBlockTests(
"capella", "Capella", capella.BeaconState, capella.SignedBeaconBlock) "capella", "Capella", capella.BeaconState, capella.SignedBeaconBlock)
from ../../../beacon_chain/spec/datatypes/deneb import from ../../beacon_chain/spec/datatypes/deneb import
BeaconState, SignedBeaconBlock BeaconState, SignedBeaconBlock
runForkBlockTests( runForkBlockTests(
"deneb", "Deneb", deneb.BeaconState, deneb.SignedBeaconBlock) "deneb", "Deneb", deneb.BeaconState, deneb.SignedBeaconBlock)

View File

@ -70,7 +70,7 @@ suite "EF - Bellatrix - Sanity - Slots " & preset():
bellatrixSanitySlotsDir, relative = true, checkDir = true): bellatrixSanitySlotsDir, relative = true, checkDir = true):
runTest(bellatrix.BeaconState, bellatrixSanitySlotsDir, "Bellatrix", suiteName, path) runTest(bellatrix.BeaconState, bellatrixSanitySlotsDir, "Bellatrix", suiteName, path)
from ../../../beacon_chain/spec/datatypes/capella import BeaconState from ../../beacon_chain/spec/datatypes/capella import BeaconState
suite "EF - Capella - Sanity - Slots " & preset(): suite "EF - Capella - Sanity - Slots " & preset():
const capellaSanitySlotsDir = sanitySlotsDir("capella") const capellaSanitySlotsDir = sanitySlotsDir("capella")
@ -78,7 +78,7 @@ suite "EF - Capella - Sanity - Slots " & preset():
capellaSanitySlotsDir, relative = true, checkDir = true): capellaSanitySlotsDir, relative = true, checkDir = true):
runTest(capella.BeaconState, capellaSanitySlotsDir, "Capella", suiteName, path) runTest(capella.BeaconState, capellaSanitySlotsDir, "Capella", suiteName, path)
from ../../../beacon_chain/spec/datatypes/deneb import BeaconState from ../../beacon_chain/spec/datatypes/deneb import BeaconState
suite "EF - Deneb - Sanity - Slots " & preset(): suite "EF - Deneb - Sanity - Slots " & preset():
const denebSanitySlotsDir = sanitySlotsDir("deneb") const denebSanitySlotsDir = sanitySlotsDir("deneb")

View File

@ -10,8 +10,8 @@
import import
std/[os, random, strutils, times], std/[os, random, strutils, times],
chronos, stew/results, unittest2, chronicles, chronos, stew/results, unittest2, chronicles,
../../beacon_chain/beacon_chain_db, ../beacon_chain/beacon_chain_db,
../../beacon_chain/spec/deposit_snapshots ../beacon_chain/spec/deposit_snapshots
from eth/db/kvstore import kvStore from eth/db/kvstore import kvStore
from nimcrypto import toDigest from nimcrypto import toDigest

View File

@ -16,7 +16,7 @@ import
../beacon_chain/spec/[forks, helpers, state_transition], ../beacon_chain/spec/[forks, helpers, state_transition],
../beacon_chain/spec/datatypes/[bellatrix, capella], ../beacon_chain/spec/datatypes/[bellatrix, capella],
# Test utilities # Test utilities
./unittest2, mocking/mock_genesis unittest2, mocking/mock_genesis
suite "Spec helpers": suite "Spec helpers":
test "integer_squareroot": test "integer_squareroot":