From 508f3b6368b839991495146d4246576e24c1539a Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Sat, 6 Jan 2024 07:18:28 +0100 Subject: [PATCH] add missing `std/` prefix to more imports (#5696) Bumping some `std` imports to explicitly include the prefix. Also add explicit `./` prefix for local directory imports. --- beacon_chain.nimble | 4 ++-- beacon_chain/beacon_clock.nim | 4 ++-- beacon_chain/el/deposit_contract.nim | 4 ++-- beacon_chain/el/merkle_minimal.nim | 4 ++-- beacon_chain/era_db.nim | 6 ++---- .../networking/network_metadata_downloads.nim | 4 ++-- beacon_chain/spec/light_client_sync.nim | 4 ++-- beacon_chain/validator_client/block_service.nim | 4 ++-- .../validator_client/doppelganger_service.nim | 4 ++-- beacon_chain/validator_client/duties_service.nim | 4 ++-- beacon_chain/validator_client/fallback_service.nim | 2 +- beacon_chain/validator_client/fork_service.nim | 4 ++-- beacon_chain/validator_client/selection_proofs.nim | 4 ++-- config.nims | 4 ++-- ncli/ncli_query.nim | 10 +++++++++- ncli/nimquery.nim | 3 +-- research/stack_sizes.nim | 9 ++++++++- scripts/run_fuzzing_test.nims | 12 +++++++++--- scripts/run_ssz_fuzzing_test.nims | 12 +++++++++--- .../altair/test_fixture_ssz_consensus_objects.nim | 7 ++++--- .../capella/test_fixture_ssz_consensus_objects.nim | 7 ++++--- .../deneb/test_fixture_ssz_consensus_objects.nim | 7 ++++--- .../phase0/test_fixture_ssz_consensus_objects.nim | 7 ++++--- .../test_fixture_ssz_generic_types.nim | 7 ++++--- tests/consensus_spec/test_fixture_transition.nim | 4 ++-- tests/fuzzing/ssz_decode_Attestation.nim | 10 ++++++++-- tests/fuzzing/ssz_decode_AttesterSlashing.nim | 10 ++++++++-- tests/fuzzing/ssz_decode_BeaconState.nim | 10 ++++++++-- tests/fuzzing/ssz_decode_ProposerSlashing.nim | 10 ++++++++-- tests/fuzzing/ssz_decode_SignedAggregateAndProof.nim | 10 ++++++++-- tests/fuzzing/ssz_decode_SignedBeaconBlock.nim | 10 ++++++++-- tests/fuzzing/ssz_decode_VoluntaryExit.nim | 10 ++++++++-- tests/helpers/debug_state.nim | 4 ++-- tests/mocking/mock_deposits.nim | 4 ++-- tests/test_keystore.nim | 4 ++-- tests/test_signing_node.nim | 4 ++-- tools/generate_makefile.nim | 5 ++--- 37 files changed, 151 insertions(+), 81 deletions(-) diff --git a/beacon_chain.nimble b/beacon_chain.nimble index 5b27dcd7c..1854aba8e 100644 --- a/beacon_chain.nimble +++ b/beacon_chain.nimble @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2023 Status Research & Development GmbH +# Copyright (c) 2018-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -50,7 +50,7 @@ requires( requires "https://gitlab.com/status-im/nimbus-security-resources.git" -import tables +import std/tables let namedBin = { "beacon_chain/nimbus_beacon_node": "nimbus_beacon_node", "beacon_chain/nimbus_validator_client": "nimbus_validator_client", diff --git a/beacon_chain/beacon_clock.nim b/beacon_chain/beacon_clock.nim index e47fa0ac6..47024dabe 100644 --- a/beacon_chain/beacon_clock.nim +++ b/beacon_chain/beacon_clock.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2023 Status Research & Development GmbH +# Copyright (c) 2018-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -12,7 +12,7 @@ import chronos/timer, chronicles, ./spec/beacon_time -from times import Time, getTime, fromUnix, `<`, `-`, inNanoseconds +from std/times import Time, getTime, fromUnix, `<`, `-`, inNanoseconds export timer.Duration, Moment, now, beacon_time diff --git a/beacon_chain/el/deposit_contract.nim b/beacon_chain/el/deposit_contract.nim index 2fc47212a..42c739bab 100644 --- a/beacon_chain/el/deposit_contract.nim +++ b/beacon_chain/el/deposit_contract.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2023 Status Research & Development GmbH +# Copyright (c) 2018-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -8,7 +8,7 @@ {.push raises: [].} import - os, sequtils, strutils, options, json, terminal, + std/[os, sequtils, strutils, options, json, terminal], chronos, chronicles, confutils, stint, json_serialization, ../filepath, ../networking/network_metadata, diff --git a/beacon_chain/el/merkle_minimal.nim b/beacon_chain/el/merkle_minimal.nim index d690e4030..6020189e9 100644 --- a/beacon_chain/el/merkle_minimal.nim +++ b/beacon_chain/el/merkle_minimal.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2023 Status Research & Development GmbH +# Copyright (c) 2018-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -13,7 +13,7 @@ # --------------------------------------------------------------- import - sequtils, + std/sequtils, stew/endians2, # Specs ../spec/[eth2_merkleization, digest], diff --git a/beacon_chain/era_db.nim b/beacon_chain/era_db.nim index 8365d9e92..c213ddcbd 100644 --- a/beacon_chain/era_db.nim +++ b/beacon_chain/era_db.nim @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2023 Status Research & Development GmbH +# Copyright (c) 2018-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -464,9 +464,7 @@ when isMainModule: # Testing EraDB gets messy because of the large amounts of data involved: # this snippet contains some sanity checks for mainnet at least - import - os, - stew/arrayops + import stew/arrayops let dbPath = diff --git a/beacon_chain/networking/network_metadata_downloads.nim b/beacon_chain/networking/network_metadata_downloads.nim index 36680223e..adeaa65e6 100644 --- a/beacon_chain/networking/network_metadata_downloads.nim +++ b/beacon_chain/networking/network_metadata_downloads.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2023 Status Research & Development GmbH +# Copyright (c) 2023-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -10,7 +10,7 @@ import stew/io2, chronos, chronos/apps/http/httpclient, snappy, ../spec/[digest, forks], ../spec/datatypes/base -import network_metadata +import ./network_metadata export network_metadata type diff --git a/beacon_chain/spec/light_client_sync.nim b/beacon_chain/spec/light_client_sync.nim index a32e4529b..ef58198ae 100644 --- a/beacon_chain/spec/light_client_sync.nim +++ b/beacon_chain/spec/light_client_sync.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2021-2023 Status Research & Development GmbH +# Copyright (c) 2021-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -10,7 +10,7 @@ import stew/[bitops2, bitseqs, objects], datatypes/altair, - helpers + ./helpers from ../consensus_object_pools/block_pools_types import VerifierError export block_pools_types.VerifierError diff --git a/beacon_chain/validator_client/block_service.nim b/beacon_chain/validator_client/block_service.nim index 11b9d52c2..f6870b3fd 100644 --- a/beacon_chain/validator_client/block_service.nim +++ b/beacon_chain/validator_client/block_service.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2021-2023 Status Research & Development GmbH +# Copyright (c) 2021-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -9,7 +9,7 @@ import chronicles, ".."/validators/activity_metrics, ".."/spec/forks, - common, api, fallback_service + "."/[common, api, fallback_service] const ServiceName = "block_service" diff --git a/beacon_chain/validator_client/doppelganger_service.nim b/beacon_chain/validator_client/doppelganger_service.nim index f820ad083..ca75c76a3 100644 --- a/beacon_chain/validator_client/doppelganger_service.nim +++ b/beacon_chain/validator_client/doppelganger_service.nim @@ -1,12 +1,12 @@ # beacon_chain -# Copyright (c) 2022-2023 Status Research & Development GmbH +# Copyright (c) 2022-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). # at your option. This file may not be copied, modified, or distributed except according to those terms. import chronicles -import common, api +import "."/[common, api] const ServiceName = "doppelganger_service" diff --git a/beacon_chain/validator_client/duties_service.nim b/beacon_chain/validator_client/duties_service.nim index 8b208b8a8..340ca49d7 100644 --- a/beacon_chain/validator_client/duties_service.nim +++ b/beacon_chain/validator_client/duties_service.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2021-2023 Status Research & Development GmbH +# Copyright (c) 2021-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -7,7 +7,7 @@ import std/[sets, sequtils] import chronicles, metrics -import common, api, block_service, selection_proofs +import "."/[common, api, block_service, selection_proofs] const ServiceName = "duties_service" diff --git a/beacon_chain/validator_client/fallback_service.nim b/beacon_chain/validator_client/fallback_service.nim index f7bab341e..5c6bce4e7 100644 --- a/beacon_chain/validator_client/fallback_service.nim +++ b/beacon_chain/validator_client/fallback_service.nim @@ -5,7 +5,7 @@ # * Apache v2 license (license terms in the root directory or at https://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 common +import ./common const ServiceName = "fallback_service" diff --git a/beacon_chain/validator_client/fork_service.nim b/beacon_chain/validator_client/fork_service.nim index d2970df5f..94a619d36 100644 --- a/beacon_chain/validator_client/fork_service.nim +++ b/beacon_chain/validator_client/fork_service.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2021-2023 Status Research & Development GmbH +# Copyright (c) 2021-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -7,7 +7,7 @@ import std/algorithm import chronicles -import common, api +import "."/[common, api] const ServiceName = "fork_service" diff --git a/beacon_chain/validator_client/selection_proofs.nim b/beacon_chain/validator_client/selection_proofs.nim index 18025dbed..a4a67278a 100644 --- a/beacon_chain/validator_client/selection_proofs.nim +++ b/beacon_chain/validator_client/selection_proofs.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2023 Status Research & Development GmbH +# Copyright (c) 2023-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -7,7 +7,7 @@ import std/[algorithm, sequtils] import chronicles, chronos, metrics -import common, api +import "."/[common, api] {.push raises: [].} diff --git a/config.nims b/config.nims index 9049041e2..af183fe11 100644 --- a/config.nims +++ b/config.nims @@ -1,11 +1,11 @@ # beacon_chain -# Copyright (c) 2020-2023 Status Research & Development GmbH +# Copyright (c) 2020-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). # at your option. This file may not be copied, modified, or distributed except according to those terms. -import strutils +import std/strutils --noNimblePath diff --git a/ncli/ncli_query.nim b/ncli/ncli_query.nim index e7833a21a..95526abad 100644 --- a/ncli/ncli_query.nim +++ b/ncli/ncli_query.nim @@ -1,5 +1,13 @@ +# beacon_chain +# Copyright (c) 2020-2024 Status Research & Development GmbH +# Licensed and distributed under either of +# * 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). +# at your option. This file may not be copied, modified, or distributed except according to those terms. + import - confutils, os, strutils, json_serialization, + std/[os, strutils], + confutils, json_serialization, stew/byteutils, ../beacon_chain/spec/[crypto, datatypes] diff --git a/ncli/nimquery.nim b/ncli/nimquery.nim index 90271c5ff..37e830d62 100644 --- a/ncli/nimquery.nim +++ b/ncli/nimquery.nim @@ -6,7 +6,7 @@ # at your option. This file may not be copied, modified, or distributed except according to those terms. import - strutils, strformat, parseutils + std/[strutils, strformat, parseutils] type TokenKind* = enum @@ -124,4 +124,3 @@ func expr(parser: var Parser): Node = func parse*(input: string): Node = var p = Parser.init(input) p.expr - diff --git a/research/stack_sizes.nim b/research/stack_sizes.nim index 37a25818a..c77bdbe82 100644 --- a/research/stack_sizes.nim +++ b/research/stack_sizes.nim @@ -1,6 +1,13 @@ +# beacon_chain +# Copyright (c) 2020-2024 Status Research & Development GmbH +# Licensed and distributed under either of +# * 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). +# at your option. This file may not be copied, modified, or distributed except according to those terms. + import ../beacon_chain/spec/datatypes/phase0 -import typetraits, strformat, strutils +import std/[typetraits, strformat, strutils] proc print(t: auto, n: string, indent: int) = echo fmt"{sizeof(t):>8} {spaces(indent)}{n}: {typeof(t).name}" diff --git a/scripts/run_fuzzing_test.nims b/scripts/run_fuzzing_test.nims index 315833ce9..063a95533 100644 --- a/scripts/run_fuzzing_test.nims +++ b/scripts/run_fuzzing_test.nims @@ -1,6 +1,13 @@ -import os except dirExists +# beacon_chain +# Copyright (c) 2020-2024 Status Research & Development GmbH +# Licensed and distributed under either of +# * 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). +# at your option. This file may not be copied, modified, or distributed except according to those terms. + +import std/os except dirExists import - sequtils, strformat, + std/[sequtils, strformat], confutils, testutils/fuzzing_engines const @@ -26,4 +33,3 @@ cli do (testname {.argument.}: string, testProgram = nimFiles[0] exec &"""ntu fuzz --fuzzer={fuzzer} --corpus="{corpusDir}" "{testProgram}" """ - diff --git a/scripts/run_ssz_fuzzing_test.nims b/scripts/run_ssz_fuzzing_test.nims index 8f2f661cf..e615176cf 100644 --- a/scripts/run_ssz_fuzzing_test.nims +++ b/scripts/run_ssz_fuzzing_test.nims @@ -1,5 +1,12 @@ -import os except dirExists -import strformat, confutils +# beacon_chain +# Copyright (c) 2020-2024 Status Research & Development GmbH +# Licensed and distributed under either of +# * 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). +# at your option. This file may not be copied, modified, or distributed except according to those terms. + +import std/os except dirExists +import std/[strformat, confutils] import testutils/fuzzing_engines const @@ -37,4 +44,3 @@ cli do (testname {.argument.}: string, let testProgram = fuzzingTestsDir / &"ssz_decode_{testname}.nim" exec &"""ntu fuzz --fuzzer={fuzzer} --corpus="{corpusDir}" "{testProgram}" """ - diff --git a/tests/consensus_spec/altair/test_fixture_ssz_consensus_objects.nim b/tests/consensus_spec/altair/test_fixture_ssz_consensus_objects.nim index 83e8062d9..de2ccecd7 100644 --- a/tests/consensus_spec/altair/test_fixture_ssz_consensus_objects.nim +++ b/tests/consensus_spec/altair/test_fixture_ssz_consensus_objects.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2023 Status Research & Development GmbH +# Copyright (c) 2018-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -9,8 +9,9 @@ import # Standard library - strutils, streams, strformat, - macros, + std/[ + strutils, streams, strformat, + macros], # Third-party yaml, # Beacon chain internals diff --git a/tests/consensus_spec/capella/test_fixture_ssz_consensus_objects.nim b/tests/consensus_spec/capella/test_fixture_ssz_consensus_objects.nim index 0d04766fa..f48b04729 100644 --- a/tests/consensus_spec/capella/test_fixture_ssz_consensus_objects.nim +++ b/tests/consensus_spec/capella/test_fixture_ssz_consensus_objects.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2022-2023 Status Research & Development GmbH +# Copyright (c) 2022-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -9,8 +9,9 @@ import # Standard library - strutils, streams, strformat, - macros, sets, + std/[ + strutils, streams, strformat, + macros, sets], # Third-party yaml, # Beacon chain internals diff --git a/tests/consensus_spec/deneb/test_fixture_ssz_consensus_objects.nim b/tests/consensus_spec/deneb/test_fixture_ssz_consensus_objects.nim index d0bec7cba..2503c88bc 100644 --- a/tests/consensus_spec/deneb/test_fixture_ssz_consensus_objects.nim +++ b/tests/consensus_spec/deneb/test_fixture_ssz_consensus_objects.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2022-2023 Status Research & Development GmbH +# Copyright (c) 2022-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -9,8 +9,9 @@ import # Standard library - strutils, streams, strformat, - macros, sets, + std/[ + strutils, streams, strformat, + macros, sets], # Third-party yaml, # Beacon chain internals diff --git a/tests/consensus_spec/phase0/test_fixture_ssz_consensus_objects.nim b/tests/consensus_spec/phase0/test_fixture_ssz_consensus_objects.nim index b63772b58..16083b85d 100644 --- a/tests/consensus_spec/phase0/test_fixture_ssz_consensus_objects.nim +++ b/tests/consensus_spec/phase0/test_fixture_ssz_consensus_objects.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2023 Status Research & Development GmbH +# Copyright (c) 2018-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -9,8 +9,9 @@ import # Standard library - strutils, streams, strformat, - macros, sets, + std/[ + strutils, streams, strformat, + macros, sets], # Third-party yaml, # Beacon chain internals diff --git a/tests/consensus_spec/test_fixture_ssz_generic_types.nim b/tests/consensus_spec/test_fixture_ssz_generic_types.nim index 484f990c8..6509418d6 100644 --- a/tests/consensus_spec/test_fixture_ssz_generic_types.nim +++ b/tests/consensus_spec/test_fixture_ssz_generic_types.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2022 Status Research & Development GmbH +# Copyright (c) 2018-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -9,8 +9,9 @@ import # Standard library - strutils, streams, strformat, strscans, - macros, typetraits, + std/[ + strutils, streams, strformat, strscans, + macros, typetraits], # Status libraries faststreams, snappy, stint, ../testutil, # Third-party diff --git a/tests/consensus_spec/test_fixture_transition.nim b/tests/consensus_spec/test_fixture_transition.nim index b1d07d91f..1db945831 100644 --- a/tests/consensus_spec/test_fixture_transition.nim +++ b/tests/consensus_spec/test_fixture_transition.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2021-2023 Status Research & Development GmbH +# Copyright (c) 2021-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -13,7 +13,7 @@ import ./os_ops from std/sequtils import toSeq -from streams import close, openFileStream +from std/streams import close, openFileStream from ../testutil import preset, suite, test from ./fixtures_utils import SszTestsDir, parseTest diff --git a/tests/fuzzing/ssz_decode_Attestation.nim b/tests/fuzzing/ssz_decode_Attestation.nim index eaf2b98ae..43b5428e6 100644 --- a/tests/fuzzing/ssz_decode_Attestation.nim +++ b/tests/fuzzing/ssz_decode_Attestation.nim @@ -1,4 +1,10 @@ -import ssz_fuzzing +# beacon_chain +# Copyright (c) 2020-2024 Status Research & Development GmbH +# Licensed and distributed under either of +# * 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). +# at your option. This file may not be copied, modified, or distributed except according to those terms. + +import ./ssz_fuzzing sszFuzzingTest Attestation - diff --git a/tests/fuzzing/ssz_decode_AttesterSlashing.nim b/tests/fuzzing/ssz_decode_AttesterSlashing.nim index 1f4376e85..c5dfc82ab 100644 --- a/tests/fuzzing/ssz_decode_AttesterSlashing.nim +++ b/tests/fuzzing/ssz_decode_AttesterSlashing.nim @@ -1,4 +1,10 @@ -import ssz_fuzzing +# beacon_chain +# Copyright (c) 2020-2024 Status Research & Development GmbH +# Licensed and distributed under either of +# * 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). +# at your option. This file may not be copied, modified, or distributed except according to those terms. + +import ./ssz_fuzzing sszFuzzingTest AttesterSlashing - diff --git a/tests/fuzzing/ssz_decode_BeaconState.nim b/tests/fuzzing/ssz_decode_BeaconState.nim index f78120be4..696729812 100644 --- a/tests/fuzzing/ssz_decode_BeaconState.nim +++ b/tests/fuzzing/ssz_decode_BeaconState.nim @@ -1,4 +1,10 @@ -import ssz_fuzzing +# beacon_chain +# Copyright (c) 2020-2024 Status Research & Development GmbH +# Licensed and distributed under either of +# * 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). +# at your option. This file may not be copied, modified, or distributed except according to those terms. + +import ./ssz_fuzzing sszFuzzingTest BeaconState - diff --git a/tests/fuzzing/ssz_decode_ProposerSlashing.nim b/tests/fuzzing/ssz_decode_ProposerSlashing.nim index ae3bb09fb..39a2820fc 100644 --- a/tests/fuzzing/ssz_decode_ProposerSlashing.nim +++ b/tests/fuzzing/ssz_decode_ProposerSlashing.nim @@ -1,4 +1,10 @@ -import ssz_fuzzing +# beacon_chain +# Copyright (c) 2020-2024 Status Research & Development GmbH +# Licensed and distributed under either of +# * 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). +# at your option. This file may not be copied, modified, or distributed except according to those terms. + +import ./ssz_fuzzing sszFuzzingTest ProposerSlashing - diff --git a/tests/fuzzing/ssz_decode_SignedAggregateAndProof.nim b/tests/fuzzing/ssz_decode_SignedAggregateAndProof.nim index 25c1b28d3..daf32832a 100644 --- a/tests/fuzzing/ssz_decode_SignedAggregateAndProof.nim +++ b/tests/fuzzing/ssz_decode_SignedAggregateAndProof.nim @@ -1,4 +1,10 @@ -import ssz_fuzzing +# beacon_chain +# Copyright (c) 2020-2024 Status Research & Development GmbH +# Licensed and distributed under either of +# * 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). +# at your option. This file may not be copied, modified, or distributed except according to those terms. + +import ./ssz_fuzzing sszFuzzingTest SignedAggregateAndProof - diff --git a/tests/fuzzing/ssz_decode_SignedBeaconBlock.nim b/tests/fuzzing/ssz_decode_SignedBeaconBlock.nim index 484d6b799..f82c79c67 100644 --- a/tests/fuzzing/ssz_decode_SignedBeaconBlock.nim +++ b/tests/fuzzing/ssz_decode_SignedBeaconBlock.nim @@ -1,4 +1,10 @@ -import ssz_fuzzing +# beacon_chain +# Copyright (c) 2020-2024 Status Research & Development GmbH +# Licensed and distributed under either of +# * 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). +# at your option. This file may not be copied, modified, or distributed except according to those terms. + +import ./ssz_fuzzing sszFuzzingTest SignedBeaconBlock - diff --git a/tests/fuzzing/ssz_decode_VoluntaryExit.nim b/tests/fuzzing/ssz_decode_VoluntaryExit.nim index 1671c4cdc..3d627c39c 100644 --- a/tests/fuzzing/ssz_decode_VoluntaryExit.nim +++ b/tests/fuzzing/ssz_decode_VoluntaryExit.nim @@ -1,4 +1,10 @@ -import ssz_fuzzing +# beacon_chain +# Copyright (c) 2020-2024 Status Research & Development GmbH +# Licensed and distributed under either of +# * 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). +# at your option. This file may not be copied, modified, or distributed except according to those terms. + +import ./ssz_fuzzing sszFuzzingTest SignedVoluntaryExit - diff --git a/tests/helpers/debug_state.nim b/tests/helpers/debug_state.nim index 5f48b9921..222cd6f6c 100644 --- a/tests/helpers/debug_state.nim +++ b/tests/helpers/debug_state.nim @@ -1,12 +1,12 @@ # beacon_chain -# Copyright (c) 2018-2022 Status Research & Development GmbH +# Copyright (c) 2018-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). # at your option. This file may not be copied, modified, or distributed except according to those terms. import - macros, + std/macros, ssz_serialization/types, ../../beacon_chain/spec/datatypes/base # digest is necessary for them to be printed as hex diff --git a/tests/mocking/mock_deposits.nim b/tests/mocking/mock_deposits.nim index 48c97b60d..12980b27d 100644 --- a/tests/mocking/mock_deposits.nim +++ b/tests/mocking/mock_deposits.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2023 Status Research & Development GmbH +# Copyright (c) 2018-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -10,7 +10,7 @@ import # Standard library - math, + std/math, # Specs ../../beacon_chain/spec/[eth2_merkleization, keystore, forks, signatures], diff --git a/tests/test_keystore.nim b/tests/test_keystore.nim index 8c8c35098..721179f0d 100644 --- a/tests/test_keystore.nim +++ b/tests/test_keystore.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2023 Status Research & Development GmbH +# Copyright (c) 2018-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -15,7 +15,7 @@ import ../beacon_chain/spec/[crypto, keystore], ./testutil -from strutils import replace +from std/strutils import replace func isEqual(a, b: ValidatorPrivKey): bool = # `==` on secret keys is not allowed diff --git a/tests/test_signing_node.nim b/tests/test_signing_node.nim index 370a87fe1..c0e4629f7 100644 --- a/tests/test_signing_node.nim +++ b/tests/test_signing_node.nim @@ -1,5 +1,5 @@ # nimbus_signing_node -# Copyright (c) 2023 Status Research & Development GmbH +# Copyright (c) 2023-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -15,7 +15,7 @@ import ../beacon_chain/filepath, ../beacon_chain/validators/validator_pool -from os import getEnv, osErrorMsg +from std/os import getEnv, osErrorMsg {.used.} diff --git a/tools/generate_makefile.nim b/tools/generate_makefile.nim index 6a85c99a8..30f16875f 100644 --- a/tools/generate_makefile.nim +++ b/tools/generate_makefile.nim @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2021 Status Research & Development GmbH +# Copyright (c) 2020-2024 Status Research & Development GmbH # Licensed and distributed under either of # * 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). @@ -8,7 +8,7 @@ # "--compileOnly". Suitable for Make-controlled parallelisation, down to the GCC # LTO level. -import json, os, strutils +import std/[json, os, strutils] # Ripped off from Nim's `linkViaResponseFile()` in "compiler/extccomp.nim". # It lets us get around a command line length limit on Windows. @@ -91,4 +91,3 @@ proc main() = makefile.writeLine("\t+ $#" % cmd.getStr().replace('\\', '/')) main() -