Use nim-eth (#82)

This commit is contained in:
Yuriy Glukhov 2019-02-05 20:21:18 +01:00 committed by Mamy Ratsimbazafy
parent d1af069c55
commit 7f1bddb267
11 changed files with 15 additions and 17 deletions

View File

@ -13,11 +13,9 @@ bin = @[
### Dependencies ### Dependencies
requires "nim >= 0.18.0", requires "nim >= 0.18.0",
"eth_common", "https://github.com/status-im/nim-eth",
"eth_keys",
"nimcrypto", "nimcrypto",
"https://github.com/status-im/nim-blscurve#master", "https://github.com/status-im/nim-blscurve#master",
"eth_p2p",
"ranges", "ranges",
"chronicles", "chronicles",
"confutils", "confutils",

View File

@ -1,8 +1,8 @@
import import
os, json, tables, options, os, json, tables, options,
chronicles, json_serialization, eth_common/eth_types_json_serialization, chronicles, json_serialization, eth/common/eth_types_json_serialization,
spec/[datatypes, digest, crypto], spec/[datatypes, digest, crypto],
eth_trie/db, ssz eth/trie/db, ssz
type type

View File

@ -1,10 +1,10 @@
import import
std_shims/[os_shims, objects], net, sequtils, options, tables, std_shims/[os_shims, objects], net, sequtils, options, tables,
asyncdispatch2, chronicles, confutils, eth_p2p, eth_keys, asyncdispatch2, chronicles, confutils, eth/[p2p, keys],
spec/[datatypes, digest, crypto, beaconstate, helpers, validator], conf, time, spec/[datatypes, digest, crypto, beaconstate, helpers, validator], conf, time,
state_transition, fork_choice, ssz, beacon_chain_db, validator_pool, extras, state_transition, fork_choice, ssz, beacon_chain_db, validator_pool, extras,
mainchain_monitor, sync_protocol, gossipsub_protocol, trusted_state_snapshots, mainchain_monitor, sync_protocol, gossipsub_protocol, trusted_state_snapshots,
eth_trie/db, eth_trie/backends/rocksdb_backend eth/trie/db, eth/trie/backends/rocksdb_backend
type type
BeaconNode* = ref object BeaconNode* = ref object

View File

@ -1,7 +1,7 @@
import import
tables, sets, macros, base64, tables, sets, macros, base64,
asyncdispatch2, nimcrypto/sysrand, chronicles, rlp, json_serialization, asyncdispatch2, nimcrypto/sysrand, chronicles, json_serialization,
eth_p2p, eth_p2p/[rlpx, peer_pool], eth/[p2p, rlp], eth/p2p/[rlpx, peer_pool],
spec/[datatypes, crypto] spec/[datatypes, crypto]
type type

View File

@ -24,7 +24,7 @@
# types / composition # types / composition
import import
eth_common, math, eth/common, math,
./crypto, ./digest ./crypto, ./digest
# TODO Data types: # TODO Data types:
@ -437,7 +437,7 @@ template epoch*(slot: int|uint64): auto =
when true: when true:
# TODO: Remove these once RLP serialization is no longer used # TODO: Remove these once RLP serialization is no longer used
import nimcrypto, rlp, json_serialization import nimcrypto, eth/rlp, json_serialization
export append, read, json_serialization export append, read, json_serialization
proc append*(rlpWriter: var RlpWriter, value: ValidatorPubKey) = proc append*(rlpWriter: var RlpWriter, value: ValidatorPubKey) =

View File

@ -21,7 +21,7 @@
# `eth2hash`, and it outputs a `Eth2Digest`. Easy to sed :) # `eth2hash`, and it outputs a `Eth2Digest`. Easy to sed :)
import import
nimcrypto/[blake2, hash], eth_common/eth_types_json_serialization, nimcrypto/[blake2, hash], eth/common/eth_types_json_serialization,
hashes hashes
export export

View File

@ -8,7 +8,7 @@
import import
options, nimcrypto, sequtils, math, options, nimcrypto, sequtils, math,
eth_common, eth/common,
../ssz, ../ssz,
./crypto, ./datatypes, ./digest, ./helpers ./crypto, ./datatypes, ./digest, ./helpers

View File

@ -10,7 +10,7 @@
import import
endians, typetraits, options, algorithm, endians, typetraits, options, algorithm,
eth_common, nimcrypto/blake2, eth/common, nimcrypto/blake2,
./spec/[crypto, datatypes, digest] ./spec/[crypto, datatypes, digest]
# ################### Helper functions ################################### # ################### Helper functions ###################################

View File

@ -1,6 +1,6 @@
import import
options, options,
chronicles, rlp, asyncdispatch2, ranges/bitranges, eth_p2p, eth_p2p/rlpx, chronicles, eth/[rlp, p2p], asyncdispatch2, ranges/bitranges, eth/p2p/rlpx,
spec/[datatypes, crypto, digest] spec/[datatypes, crypto, digest]
type type

View File

@ -1,6 +1,6 @@
import import
json, macros, sequtils, endians, json, macros, sequtils, endians,
eth_common, stint, nimcrypto, byteutils eth/common, stint, nimcrypto, byteutils
type type
Validator {.packed.} = object Validator {.packed.} = object

View File

@ -6,7 +6,7 @@
# at your option. This file may not be copied, modified, or distributed except according to those terms. # at your option. This file may not be copied, modified, or distributed except according to those terms.
import import
unittest, nimcrypto, eth_common, sequtils, options, blscurve, unittest, nimcrypto, eth/common, sequtils, options, blscurve,
../beacon_chain/ssz, ../beacon_chain/spec/datatypes ../beacon_chain/ssz, ../beacon_chain/spec/datatypes
func filled[N: static[int], T](typ: type array[N, T], value: T): array[N, T] = func filled[N: static[int], T](typ: type array[N, T], value: T): array[N, T] =