From 7080ca40da6a66086208c5287097ce97651b0d17 Mon Sep 17 00:00:00 2001 From: andri lim Date: Mon, 4 May 2020 18:52:45 +0700 Subject: [PATCH] multi keys prototype --- stateless/multi_keys.nim | 187 ++++++++++++++++++++++++++------------- 1 file changed, 124 insertions(+), 63 deletions(-) diff --git a/stateless/multi_keys.nim b/stateless/multi_keys.nim index 00c6e66c2..75607dc5f 100644 --- a/stateless/multi_keys.nim +++ b/stateless/multi_keys.nim @@ -1,36 +1,30 @@ -import eth/common, eth/trie/db, tables, algorithm, stew/byteutils +import + eth/common, eth/trie/[db, nibbles], algorithm, stew/byteutils, + ./witness_types type KeyHash = array[32, byte] - Multikeys = object - hash: seq[KeyHash] + HashAddress = object + visited: bool + hash: KeyHash + address: EthAddress - Group = object - a, b: int + Multikeys* = object + keys: seq[HashAddress] -proc toHash(x: string): KeyHash = - let len = min(x.len, 32) - for i in 0..