mirror of https://github.com/status-im/nim-eth.git
std_shims -> stew
This commit is contained in:
parent
3d2436d3df
commit
75c7c62651
|
@ -6,14 +6,12 @@ skipDirs = @["tests"]
|
||||||
|
|
||||||
requires "nim >= 0.19.0",
|
requires "nim >= 0.19.0",
|
||||||
"nimcrypto",
|
"nimcrypto",
|
||||||
"ranges",
|
|
||||||
"stint",
|
"stint",
|
||||||
"byteutils",
|
|
||||||
"secp256k1",
|
"secp256k1",
|
||||||
"rocksdb",
|
"rocksdb",
|
||||||
"chronos",
|
"chronos",
|
||||||
"chronicles",
|
"chronicles",
|
||||||
"std_shims",
|
"stew",
|
||||||
"result",
|
"result",
|
||||||
"nat_traversal"
|
"nat_traversal"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import nimcrypto, hashes, byteutils, eth_types
|
import nimcrypto, hashes, stew/byteutils, eth_types
|
||||||
|
|
||||||
proc hash*(d: MDigest): Hash {.inline.} = hash(d.data)
|
proc hash*(d: MDigest): Hash {.inline.} = hash(d.data)
|
||||||
|
|
||||||
|
|
|
@ -311,7 +311,7 @@ proc randomNodes*(d: DiscoveryProtocol, count: int): seq[Node] {.inline.} =
|
||||||
d.kademlia.randomNodes(count)
|
d.kademlia.randomNodes(count)
|
||||||
|
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
import logging, byteutils
|
import logging, stew/byteutils
|
||||||
|
|
||||||
addHandler(newConsoleLogger())
|
addHandler(newConsoleLogger())
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import
|
import
|
||||||
macros, options,
|
options,
|
||||||
std_shims/macros_shim, chronos, faststreams/output_stream
|
stew/shims/macros, chronos, faststreams/output_stream
|
||||||
|
|
||||||
type
|
type
|
||||||
MessageKind* = enum
|
MessageKind* = enum
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import
|
import
|
||||||
macros, tables, algorithm, deques, hashes, options, typetraits,
|
tables, algorithm, deques, hashes, options, typetraits,
|
||||||
std_shims/macros_shim, chronicles, nimcrypto, chronos, eth/[rlp, common, keys, async_utils],
|
stew/shims/macros, chronicles, nimcrypto, chronos, eth/[rlp, common, keys, async_utils],
|
||||||
private/p2p_types, kademlia, auth, rlpxcrypt, enode, p2p_protocol_dsl
|
private/p2p_types, kademlia, auth, rlpxcrypt, enode, p2p_protocol_dsl
|
||||||
|
|
||||||
when useSnappy:
|
when useSnappy:
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import
|
import
|
||||||
times, tables, options, sets, hashes, strutils, std_shims/macros_shim,
|
times, tables, options, sets, hashes, strutils, stew/shims/macros,
|
||||||
chronicles, chronos, nimcrypto/[keccak, hash],
|
chronicles, chronos, nimcrypto/[keccak, hash],
|
||||||
eth/[rlp, keys], eth/common/eth_types,
|
eth/[rlp, keys], eth/common/eth_types,
|
||||||
../rlpx, ../kademlia, ../private/p2p_types, ../blockchain_utils,
|
../rlpx, ../kademlia, ../private/p2p_types, ../blockchain_utils,
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
import
|
import
|
||||||
algorithm, bitops, endians, math, options, sequtils, strutils, tables, times,
|
algorithm, bitops, endians, math, options, sequtils, strutils, tables, times,
|
||||||
secp256k1, chronicles, chronos, eth/common/eth_types, eth/[keys, rlp, async_utils],
|
secp256k1, chronicles, chronos, eth/common/eth_types, eth/[keys, rlp, async_utils],
|
||||||
hashes, byteutils, nimcrypto/[bcmode, hash, keccak, rijndael, sysrand],
|
hashes, stew/byteutils, nimcrypto/[bcmode, hash, keccak, rijndael, sysrand],
|
||||||
eth/p2p, ../ecies
|
eth/p2p, ../ecies
|
||||||
|
|
||||||
logScope:
|
logScope:
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
## This module implements RLPx cryptography
|
## This module implements RLPx cryptography
|
||||||
|
|
||||||
import ranges/stackarrays, eth/rlp/types, nimcrypto
|
import stew/ranges/stackarrays, eth/rlp/types, nimcrypto
|
||||||
from auth import ConnectionSecret
|
from auth import ConnectionSecret
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import ranges
|
import stew/ranges
|
||||||
export ranges
|
export ranges
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import
|
import
|
||||||
macros, types,
|
macros, types,
|
||||||
ranges/[memranges, ptr_arith],
|
stew/ranges/[memranges, ptr_arith],
|
||||||
object_serialization, priv/defs
|
object_serialization, priv/defs
|
||||||
|
|
||||||
export
|
export
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import
|
import
|
||||||
ranges, tables, sets,
|
stew/ranges, tables, sets,
|
||||||
eth/trie/db
|
eth/trie/db
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import os, ranges, eth/trie/[trie_defs, db_tracing]
|
import os, stew/ranges, eth/trie/[trie_defs, db_tracing]
|
||||||
import backend_defs
|
import backend_defs
|
||||||
|
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
|
@ -157,7 +157,7 @@ proc newChainDB*(basePath: string, readOnly = false): ChainDB =
|
||||||
|
|
||||||
ok = mdb_env_set_mapsize(result.env, LMDB_MAP_SIZE) == 0
|
ok = mdb_env_set_mapsize(result.env, LMDB_MAP_SIZE) == 0
|
||||||
if not ok: raiseStorageInitError()
|
if not ok: raiseStorageInitError()
|
||||||
|
|
||||||
var openFlags = MDB_NOSUBDIR
|
var openFlags = MDB_NOSUBDIR
|
||||||
if readOnly: openFlags = openFlags or MDB_RDONLY
|
if readOnly: openFlags = openFlags or MDB_RDONLY
|
||||||
# file mode ignored on windows
|
# file mode ignored on windows
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import os, rocksdb, ranges, eth/trie/[trie_defs, db_tracing]
|
import os, rocksdb, stew/ranges, eth/trie/[trie_defs, db_tracing]
|
||||||
import backend_defs
|
import backend_defs
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import
|
import
|
||||||
os, sqlite3, ranges, ranges/ptr_arith, eth/trie/[db_tracing, trie_defs],
|
os, sqlite3, stew/ranges, stew/ranges/ptr_arith, eth/trie/[db_tracing, trie_defs],
|
||||||
backend_defs
|
backend_defs
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import
|
import
|
||||||
sequtils,
|
sequtils,
|
||||||
ranges/[ptr_arith, bitranges], eth/rlp/types
|
stew/ranges/[ptr_arith, bitranges], eth/rlp/types
|
||||||
|
|
||||||
type
|
type
|
||||||
TrieNodeKind* = enum
|
TrieNodeKind* = enum
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import
|
import
|
||||||
ranges/[ptr_arith, typedranges, bitranges], eth/rlp/types,
|
stew/ranges/[ptr_arith, typedranges, bitranges], eth/rlp/types,
|
||||||
trie_defs, db, binaries, trie_utils
|
trie_defs, db, binaries, trie_utils
|
||||||
|
|
||||||
export
|
export
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import
|
import
|
||||||
eth/rlp/types, ranges/bitranges,
|
eth/rlp/types, stew/ranges/bitranges,
|
||||||
trie_defs, binary, binaries, db, trie_utils
|
trie_defs, binary, binaries, db, trie_utils
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import
|
import
|
||||||
tables,
|
tables,
|
||||||
nimcrypto/[keccak, hash, utils], ranges/ptr_arith, eth/rlp,
|
nimcrypto/[keccak, hash, utils], stew/ranges/ptr_arith, eth/rlp,
|
||||||
trie_defs, nibbles, trie_utils as trieUtils, db
|
trie_defs, nibbles, trie_utils as trieUtils, db
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import
|
import
|
||||||
ranges/[ptr_arith, typedranges, bitranges], eth/rlp/types,
|
stew/ranges/[ptr_arith, typedranges, bitranges], eth/rlp/types,
|
||||||
trie_defs, trie_utils, db, sparse_proofs
|
trie_defs, trie_utils, db, sparse_proofs
|
||||||
|
|
||||||
export
|
export
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import
|
import
|
||||||
ranges/[typedranges, bitranges],
|
stew/ranges/[typedranges, bitranges],
|
||||||
trie_defs, db, trie_utils
|
trie_defs, db, trie_utils
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import
|
import
|
||||||
eth/rlp, ranges/typedranges, nimcrypto/hash
|
eth/rlp, stew/ranges/typedranges, nimcrypto/hash
|
||||||
|
|
||||||
export
|
export
|
||||||
typedranges, Bytes
|
typedranges, Bytes
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import
|
import
|
||||||
strutils, parseutils,
|
strutils, parseutils,
|
||||||
ranges/[typedranges, ptr_arith], nimcrypto/[hash, keccak],
|
stew/ranges/[typedranges, ptr_arith], nimcrypto/[hash, keccak],
|
||||||
trie_defs, binaries
|
trie_defs, binaries
|
||||||
|
|
||||||
#proc baseAddr*(x: Bytes): ptr byte = x[0].unsafeAddr
|
#proc baseAddr*(x: Bytes): ptr byte = x[0].unsafeAddr
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import
|
import
|
||||||
streams, posix, sequtils, strutils, chronicles, chronos, byteutils,
|
streams, posix, sequtils, strutils, chronicles, chronos, stew/byteutils,
|
||||||
eth/p2p/[discovery, kademlia, enode], eth/[keys, rlp],
|
eth/p2p/[discovery, kademlia, enode], eth/[keys, rlp],
|
||||||
../../p2p/p2p_test_helper
|
../../p2p/p2p_test_helper
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import
|
import
|
||||||
unittest, strutils,
|
unittest, strutils,
|
||||||
ranges/bitranges, eth/rlp/types, nimcrypto/[keccak, hash],
|
stew/ranges/bitranges, eth/rlp/types, nimcrypto/[keccak, hash],
|
||||||
eth/trie/[binaries, trie_utils],
|
eth/trie/[binaries, trie_utils],
|
||||||
./testutils
|
./testutils
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import
|
import
|
||||||
unittest, strutils, sequtils, os,
|
unittest, strutils, sequtils, os,
|
||||||
ranges/typedranges, eth/trie/[hexary, db, trie_defs], nimcrypto/utils,
|
stew/ranges/typedranges, eth/trie/[hexary, db, trie_defs], nimcrypto/utils,
|
||||||
./testutils, algorithm, eth/rlp/types as rlpTypes, random
|
./testutils, algorithm, eth/rlp/types as rlpTypes, random
|
||||||
|
|
||||||
template put(t: HexaryTrie|SecureHexaryTrie, key, val: string) =
|
template put(t: HexaryTrie|SecureHexaryTrie, key, val: string) =
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import
|
import
|
||||||
random, sets, eth/trie/trie_utils as ethUtils,
|
random, sets, eth/trie/trie_utils as ethUtils,
|
||||||
eth/rlp/types as rlpTypes, ranges/bitranges,
|
eth/rlp/types as rlpTypes, stew/ranges/bitranges,
|
||||||
nimcrypto/[utils, sysrand]
|
nimcrypto/[utils, sysrand]
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
Loading…
Reference in New Issue