Skip to content

Commit

Permalink
results: use canonical import (#2248)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnetheduck committed May 30, 2024
1 parent 198e9c6 commit 919242c
Show file tree
Hide file tree
Showing 76 changed files with 126 additions and 97 deletions.
2 changes: 1 addition & 1 deletion fluffy/common/common_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{.push raises: [].}

import ssz_serialization, eth/rlp, stew/[byteutils, results], nimcrypto/hash
import results, ssz_serialization, eth/rlp, stew/byteutils, nimcrypto/hash

export hash

Expand Down
2 changes: 1 addition & 1 deletion fluffy/database/content_db.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import
chronicles,
metrics,
stint,
stew/results,
results,
eth/db/kvstore,
eth/db/kvstore_sqlite3,
../network/state/state_content,
Expand Down
3 changes: 2 additions & 1 deletion fluffy/eth_data/history_data_json_store.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import
json_serialization,
json_serialization/std/tables,
stew/[byteutils, io2, results],
results,
stew/[byteutils, io2],
chronicles,
eth/[rlp, common/eth_types],
../../nimbus/common/[chain_config, genesis],
Expand Down
3 changes: 2 additions & 1 deletion fluffy/eth_data/history_data_ssz_e2s.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
{.push raises: [].}

import
stew/[byteutils, io2, results],
stew/[byteutils, io2],
chronicles,
results,
eth/[rlp, common/eth_types],
ncli/e2store,
../network/history/[history_content, accumulator]
Expand Down
3 changes: 2 additions & 1 deletion fluffy/fluffy.nim
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import
metrics/chronos_httpserver,
json_rpc/clients/httpclient,
json_rpc/rpcproxy,
stew/[byteutils, io2, results],
results,
stew/[byteutils, io2],
eth/keys,
eth/net/nat,
eth/p2p/discoveryv5/protocol as discv5_protocol,
Expand Down
2 changes: 1 addition & 1 deletion fluffy/logging.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import
pkg/chronicles,
pkg/chronicles/helpers,
chronicles/topics_registry,
pkg/stew/results
pkg/results

export results

Expand Down
3 changes: 2 additions & 1 deletion fluffy/network/beacon/beacon_content.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

import
std/typetraits,
stew/[arrayops, results],
stew/arrayops,
results,
beacon_chain/spec/forks,
beacon_chain/spec/datatypes/altair,
nimcrypto/[sha2, hash],
Expand Down
2 changes: 1 addition & 1 deletion fluffy/network/beacon/beacon_db.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import
eth/db/kvstore,
eth/db/kvstore_sqlite3,
stint,
stew/results,
results,
ssz_serialization,
beacon_chain/db_limits,
beacon_chain/spec/datatypes/[phase0, altair, bellatrix],
Expand Down
3 changes: 2 additions & 1 deletion fluffy/network/beacon/beacon_light_client_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import
std/typetraits,
chronos,
chronicles,
stew/[base10, results],
stew/base10,
results,
eth/p2p/discoveryv5/random2,
beacon_chain/spec/datatypes/[phase0, altair, bellatrix, capella, deneb],
beacon_chain/spec/[forks_light_client, digest],
Expand Down
2 changes: 1 addition & 1 deletion fluffy/network/beacon/beacon_network.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{.push raises: [].}

import
stew/results,
results,
chronos,
chronicles,
eth/p2p/discoveryv5/[protocol, enr],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
{.push raises: [].}

import
stew/results,
results,
ssz_serialization,
ssz_serialization/[proofs, merkleization],
beacon_chain/spec/eth2_ssz_serialization,
Expand Down
2 changes: 1 addition & 1 deletion fluffy/network/history/beacon_chain_historical_roots.nim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

{.push raises: [].}

import stew/results, beacon_chain/spec/forks, beacon_chain/spec/datatypes/bellatrix
import results, beacon_chain/spec/forks, beacon_chain/spec/datatypes/bellatrix

export results

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{.push raises: [].}

import
stew/results,
results,
ssz_serialization,
ssz_serialization/[proofs, merkleization],
beacon_chain/spec/eth2_ssz_serialization,
Expand Down
3 changes: 2 additions & 1 deletion fluffy/network/history/history_content.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
import
std/math,
nimcrypto/[sha2, hash],
stew/[byteutils, results],
stew/byteutils,
results,
stint,
ssz_serialization,
../../common/common_types
Expand Down
2 changes: 1 addition & 1 deletion fluffy/network/history/history_network.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{.push raises: [].}

import
stew/results,
results,
chronos,
chronicles,
eth/[common/eth_types_rlp, rlp, trie, trie/db],
Expand Down
2 changes: 1 addition & 1 deletion fluffy/network/wire/messages.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{.push raises: [].}

import
stint, stew/[results, objects, endians2], ssz_serialization, ../../common/common_types
stint, stew/[objects, endians2], ssz_serialization, ../../common/common_types, results

export ssz_serialization, stint, common_types

Expand Down
3 changes: 2 additions & 1 deletion fluffy/network/wire/portal_protocol.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

import
std/[sequtils, sets, algorithm, tables],
stew/[results, byteutils, leb128, endians2],
stew/[byteutils, leb128, endians2],
results,
chronicles,
chronos,
nimcrypto/hash,
Expand Down
3 changes: 2 additions & 1 deletion fluffy/rpc/rpc_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import
stint,
json_rpc/jsonmarshal,
stew/[results, byteutils],
stew/[byteutils],
results,
eth/p2p/discoveryv5/[routing_table, enr, node]

export jsonmarshal, routing_table, enr, node
Expand Down
2 changes: 1 addition & 1 deletion fluffy/tests/beacon_network_tests/test_beacon_content.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import
unittest2,
stew/byteutils,
stew/io2,
stew/results,
results,
beacon_chain/networking/network_metadata,
beacon_chain/spec/forks,
beacon_chain/spec/datatypes/altair,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
import
unittest2,
stint,
stew/[byteutils, results],
stew/byteutils,
results,
eth/[common/eth_types, rlp],
../../../common/common_types,
../../../eth_data/history_data_json_store,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import
unittest2,
stint,
stew/[byteutils, results],
stew/byteutils,
results,
eth/p2p/discoveryv5/enr,
../../../network/wire/messages

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import
std/os,
unittest2,
stew/results,
results,
eth/[common, trie, trie/db],
../../../nimbus/common/chain_config,
../../network/state/[state_content, state_validation, state_gossip, state_utils],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import
std/os,
unittest2,
stew/results,
results,
eth/[common, trie, trie/trie_defs],
../../../nimbus/common/chain_config,
../../network/state/[state_content, state_validation],
Expand Down
4 changes: 1 addition & 3 deletions fluffy/tests/test_history_util.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
{.push raises: [].}

import
stew/results,
eth/common/eth_types_rlp,
../network/history/[history_content, accumulator]
results, eth/common/eth_types_rlp, ../network/history/[history_content, accumulator]

export results, accumulator, history_content

Expand Down
2 changes: 1 addition & 1 deletion fluffy/tests/test_portal_wire_protocol.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import
std/[algorithm, sequtils],
chronos,
testutils/unittests,
stew/results,
results,
eth/keys,
eth/p2p/discoveryv5/routing_table,
nimcrypto/[hash, sha2],
Expand Down
3 changes: 2 additions & 1 deletion fluffy/tools/portalcli.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import
chronos,
metrics,
metrics/chronos_httpserver,
stew/[byteutils, results],
stew/byteutils,
results,
nimcrypto/[hash, sha2],
eth/[keys, net/nat],
eth/p2p/discoveryv5/[enr, node],
Expand Down
2 changes: 1 addition & 1 deletion hive_integration/nodocker/engine/cancun/blobs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import
kzg4844/kzg_ex as kzg,
stew/endians2,
nimcrypto/sha2,
stew/results,
results,
../../../../nimbus/core/eip4844

type
Expand Down
2 changes: 1 addition & 1 deletion hive_integration/nodocker/engine/engine_env.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import
eth/p2p as eth_p2p,
chronos,
json_rpc/[rpcserver, rpcclient],
stew/[results],
results,
../../../nimbus/[
config,
constants,
Expand Down
2 changes: 1 addition & 1 deletion hive_integration/nodocker/engine/engine_sim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import
std/times,
chronicles,
stew/results,
results,
./types,
../sim_utils,
../../../nimbus/core/eip4844
Expand Down
2 changes: 1 addition & 1 deletion hive_integration/nodocker/engine/test_env.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import
chronicles,
eth/keys,
stew/results,
results,
json_rpc/rpcclient,
../../../nimbus/config,
../../../nimbus/common,
Expand Down
2 changes: 1 addition & 1 deletion hive_integration/nodocker/rpc/test_env.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import
std/[os, net],
eth/p2p as ethp2p,
stew/results,
results,
chronos, json_rpc/[rpcserver, rpcclient],
../../../nimbus/sync/protocol,
../../../nimbus/common,
Expand Down
2 changes: 1 addition & 1 deletion nimbus/beacon/api_handler/api_forkchoice.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import
std/[typetraits],
eth/common,
stew/results,
results,
../web3_eth_conv,
../beacon_engine,
web3/execution_types,
Expand Down
2 changes: 1 addition & 1 deletion nimbus/beacon/api_handler/api_newpayload.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import
eth/common,
stew/results,
results,
../web3_eth_conv,
../beacon_engine,
web3/execution_types,
Expand Down
3 changes: 2 additions & 1 deletion nimbus/beacon/api_handler/api_utils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import
eth/[rlp],
json_rpc/errors,
nimcrypto/[hash, sha2],
stew/[results, endians2],
stew/endians2,
results,
../../constants,
../../db/core_db,
../../utils/utils,
Expand Down
5 changes: 3 additions & 2 deletions nimbus/common/context.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Nimbus
# Copyright (c) 2021 Status Research & Development GmbH
# Copyright (c) 2021-2024 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
Expand All @@ -10,7 +10,8 @@
import
std/[strutils, os],
manager,
stew/[results, io2, byteutils],
stew/[io2, byteutils],
results,
eth/keys

export manager
Expand Down
7 changes: 4 additions & 3 deletions nimbus/common/manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

import
std/[os, json, tables, strutils],
stew/[byteutils, results],
stew/byteutils,
results,
eth/[keyfile, common, keys],
json_serialization

Expand All @@ -29,7 +30,7 @@ type
proc init*(_: type AccountsManager): AccountsManager =
discard

proc loadKeystores*(am: var AccountsManager, path: string):
proc loadKeystores*(am: var AccountsManager, path: string):
Result[void, string] =
try:
createDir(path)
Expand All @@ -39,7 +40,7 @@ proc loadKeystores*(am: var AccountsManager, path: string):
am.accounts[address] = NimbusAccount(keystore: data, unlocked: false)
except CatchableError as exc:
return err("loadKeystrores: " & exc.msg)

ok()

proc getAccount*(am: var AccountsManager, address: EthAddress): Result[NimbusAccount, string] =
Expand Down
2 changes: 1 addition & 1 deletion nimbus/core/eip4844.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import
std/[os, strutils],
nimcrypto/sha2,
kzg4844/kzg_ex as kzg,
stew/results,
results,
stint,
../constants,
../common/common
Expand Down
2 changes: 1 addition & 1 deletion nimbus/core/executor/process_block.nim
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import
./executor_helpers,
./process_transaction,
chronicles,
stew/results
results

{.push raises: [].}

Expand Down
2 changes: 1 addition & 1 deletion nimbus/core/executor/process_transaction.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import
std/strutils,
stew/results,
results,
../../common/common,
../../db/ledger,
../../transaction/call_evm,
Expand Down

0 comments on commit 919242c

Please sign in to comment.