fixes related to stint breaking changes

This commit is contained in:
jangko 2023-06-09 21:26:17 +07:00
parent c3860244b1
commit 6dacb2ca5c
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
3 changed files with 11 additions and 2 deletions

View File

@ -34,6 +34,15 @@ proc read*(rlp: var Rlp, T: type StUint): T {.inline.} =
rlp.skipElem
func significantBytesBE(val: openArray[byte]): int =
## Returns the number of significant trailing bytes in a big endian
## representation of a number.
# TODO: move that in https://github.com/status-im/nim-byteutils
for i in 0 ..< val.len:
if val[i] != 0:
return val.len - i
return 1
proc append*(rlpWriter: var RlpWriter, value: StUint) =
if value > 128:
let bytes = value.toByteArrayBE

View File

@ -16,7 +16,7 @@
import
std/[tables, options, hashes, net],
nimcrypto/[bcmode, rijndael, sha2], stint, chronicles,
stew/[results, byteutils], metrics,
stew/[results, byteutils, endians2], metrics,
".."/../[rlp, keys],
"."/[messages_encoding, node, enr, hkdf, sessions]

View File

@ -11,7 +11,7 @@ import
std/[algorithm, times, sequtils, bitops, sets, options],
bearssl/rand,
stint, chronicles, metrics, chronos, stew/shims/net as stewNet,
../../net/utils,
../../net/utils, stew/endians2,
"."/[node, random2, enr]
export options