Use SSZ code from nim-ssz-serialization module (#875)
This commit is contained in:
parent
02e8b2eb12
commit
0ba3c682e4
|
@ -193,3 +193,8 @@
|
|||
url = https://github.com/status-im/nim-websock
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-ssz-serialization"]
|
||||
path = vendor/nim-ssz-serialization
|
||||
url = https://github.com/status-im/nim-ssz-serialization.git
|
||||
ignore = untracked
|
||||
branch = master
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{.push raises: [Defect].}
|
||||
|
||||
import
|
||||
eth/ssz/ssz_serialization
|
||||
ssz_serialization/types
|
||||
|
||||
type
|
||||
ByteList* = List[byte, 2048]
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
import
|
||||
std/options,
|
||||
nimcrypto/[sha2, hash], stew/objects, stint,
|
||||
eth/ssz/ssz_serialization,
|
||||
ssz_serialization,
|
||||
../../common/common_types
|
||||
|
||||
export ssz_serialization, common_types
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
import
|
||||
std/options,
|
||||
nimcrypto/[sha2, hash], stew/objects, stint,
|
||||
eth/ssz/ssz_serialization,
|
||||
ssz_serialization,
|
||||
../../common/common_types
|
||||
|
||||
export ssz_serialization, common_types
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
import
|
||||
std/options,
|
||||
stint, stew/[results, objects],
|
||||
eth/ssz/ssz_serialization,
|
||||
ssz_serialization,
|
||||
../../common/common_types
|
||||
|
||||
export ssz_serialization, stint, common_types
|
||||
|
@ -114,9 +114,6 @@ template messageKind*(T: typedesc[SomeMessage]): MessageKind =
|
|||
template toSszType*(x: UInt256): array[32, byte] =
|
||||
toBytesLE(x)
|
||||
|
||||
template toSszType*(x: auto): auto =
|
||||
x
|
||||
|
||||
func fromSszBytes*(T: type UInt256, data: openArray[byte]):
|
||||
T {.raises: [MalformedSszError, Defect].} =
|
||||
if data.len != sizeof(result):
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
import
|
||||
std/[sequtils, sets, algorithm],
|
||||
stew/results, chronicles, chronos, nimcrypto/hash,
|
||||
ssz_serialization,
|
||||
eth/rlp, eth/p2p/discoveryv5/[protocol, node, enr, routing_table, random2, nodes_verification],
|
||||
eth/ssz/ssz_serialization,
|
||||
./messages
|
||||
|
||||
export messages, routing_table
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import
|
||||
std/os,
|
||||
testutils/unittests,
|
||||
eth/[keys, trie/db, trie/hexary, ssz/ssz_serialization],
|
||||
eth/[keys, trie/db, trie/hexary],
|
||||
eth/p2p/discoveryv5/protocol as discv5_protocol, eth/p2p/discoveryv5/routing_table,
|
||||
../../nimbus/[genesis, chain_config, config, db/db_chain],
|
||||
../network/wire/portal_protocol,
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 5d65b20d6b56265902e5c9b6a2be4d1c2fd6427e
|
Loading…
Reference in New Issue