mirror of
https://github.com/logos-storage/logos-storage-nim-dht.git
synced 2026-01-08 00:13:07 +00:00
bump stew
`results` is its own package
This commit is contained in:
parent
2bdfb04382
commit
4fa5c57ecc
@ -16,7 +16,7 @@ requires "chronicles >= 0.10.2 & < 0.11.0"
|
|||||||
requires "chronos >= 4.0.3 & < 4.1.0"
|
requires "chronos >= 4.0.3 & < 4.1.0"
|
||||||
requires "libp2p >= 1.5.0 & < 2.0.0"
|
requires "libp2p >= 1.5.0 & < 2.0.0"
|
||||||
requires "metrics >= 0.1.0 & < 0.2.0"
|
requires "metrics >= 0.1.0 & < 0.2.0"
|
||||||
requires "stew >= 0.2.0 & < 0.3.0"
|
requires "stew >= 0.2.0"
|
||||||
requires "stint >= 0.8.1 & < 0.9.0"
|
requires "stint >= 0.8.1 & < 0.9.0"
|
||||||
requires "https://github.com/codex-storage/nim-datastore >= 0.2.0 & < 0.3.0"
|
requires "https://github.com/codex-storage/nim-datastore >= 0.2.0 & < 0.3.0"
|
||||||
requires "questionable >= 0.10.15 & < 0.11.0"
|
requires "questionable >= 0.10.15 & < 0.11.0"
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import
|
import
|
||||||
std/sugar,
|
std/sugar,
|
||||||
libp2p/crypto/[crypto, secp],
|
libp2p/crypto/[crypto, secp],
|
||||||
stew/[byteutils, objects, results, ptrops]
|
stew/[byteutils, objects, ptrops],
|
||||||
|
results
|
||||||
|
|
||||||
# from secp256k1 import ecdh, SkEcdhSecretSize, toRaw, SkSecretKey, SkPublicKey
|
# from secp256k1 import ecdh, SkEcdhSecretSize, toRaw, SkSecretKey, SkPublicKey
|
||||||
import secp256k1
|
import secp256k1
|
||||||
|
|||||||
@ -18,13 +18,14 @@ import
|
|||||||
stew/endians2,
|
stew/endians2,
|
||||||
bearssl/rand,
|
bearssl/rand,
|
||||||
chronicles,
|
chronicles,
|
||||||
stew/[results, byteutils],
|
stew/[byteutils],
|
||||||
stint,
|
stint,
|
||||||
libp2p/crypto/crypto as libp2p_crypto,
|
libp2p/crypto/crypto as libp2p_crypto,
|
||||||
libp2p/crypto/secp,
|
libp2p/crypto/secp,
|
||||||
libp2p/signed_envelope,
|
libp2p/signed_envelope,
|
||||||
metrics,
|
metrics,
|
||||||
nimcrypto,
|
nimcrypto,
|
||||||
|
results,
|
||||||
"."/[messages, messages_encoding, node, spr, hkdf, sessions],
|
"."/[messages, messages_encoding, node, spr, hkdf, sessions],
|
||||||
"."/crypto
|
"."/crypto
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,9 @@ func newNode*(r: SignedPeerRecord): Result[Node, cstring] =
|
|||||||
nodeId = ? pk.get().toNodeId()
|
nodeId = ? pk.get().toNodeId()
|
||||||
|
|
||||||
if r.ip.isSome() and r.udp.isSome():
|
if r.ip.isSome() and r.udp.isSome():
|
||||||
let a = Address(ip: ipv4(r.ip.get()), port: Port(r.udp.get()))
|
let a = Address(
|
||||||
|
ip: IpAddress(family: IPv4, address_v4: r.ip.get()), port: Port(r.udp.get())
|
||||||
|
)
|
||||||
|
|
||||||
ok(Node(
|
ok(Node(
|
||||||
id: nodeId,
|
id: nodeId,
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
{.push raises: [].}
|
{.push raises: [].}
|
||||||
|
|
||||||
import
|
import
|
||||||
std/[sets, options],
|
std/[net, sets, options],
|
||||||
stew/results, stew/shims/net, chronicles, chronos,
|
results, chronicles, chronos,
|
||||||
"."/[node, spr, routing_table]
|
"."/[node, spr, routing_table]
|
||||||
|
|
||||||
logScope:
|
logScope:
|
||||||
|
|||||||
@ -74,15 +74,15 @@
|
|||||||
{.push raises: [].}
|
{.push raises: [].}
|
||||||
|
|
||||||
import
|
import
|
||||||
std/[tables, sets, options, math, sequtils, algorithm, strutils],
|
std/[net, tables, sets, options, math, sequtils, algorithm, strutils],
|
||||||
stew/shims/net as stewNet,
|
|
||||||
json_serialization/std/net,
|
json_serialization/std/net,
|
||||||
stew/[base64, endians2, results],
|
stew/[base64, endians2],
|
||||||
pkg/[chronicles, chronicles/chronos_tools],
|
pkg/[chronicles, chronicles/chronos_tools],
|
||||||
pkg/chronos,
|
pkg/chronos,
|
||||||
pkg/stint,
|
pkg/stint,
|
||||||
pkg/bearssl/rand,
|
pkg/bearssl/rand,
|
||||||
pkg/metrics
|
pkg/metrics,
|
||||||
|
pkg/results
|
||||||
|
|
||||||
import "."/[
|
import "."/[
|
||||||
messages,
|
messages,
|
||||||
|
|||||||
@ -14,7 +14,6 @@ import pkg/datastore
|
|||||||
import pkg/chronos
|
import pkg/chronos
|
||||||
import pkg/libp2p
|
import pkg/libp2p
|
||||||
import pkg/chronicles
|
import pkg/chronicles
|
||||||
import pkg/stew/results as rs
|
|
||||||
import pkg/stew/byteutils
|
import pkg/stew/byteutils
|
||||||
import pkg/questionable
|
import pkg/questionable
|
||||||
import pkg/questionable/results
|
import pkg/questionable/results
|
||||||
|
|||||||
@ -8,8 +8,8 @@
|
|||||||
{.push raises: [].}
|
{.push raises: [].}
|
||||||
|
|
||||||
import
|
import
|
||||||
std/[algorithm, times, sequtils, bitops, sets, options, tables],
|
std/[algorithm, net, times, sequtils, bitops, sets, options, tables],
|
||||||
stint, chronicles, metrics, bearssl/rand, chronos, stew/shims/net as stewNet,
|
stint, chronicles, metrics, bearssl/rand, chronos,
|
||||||
"."/[node, random2, spr]
|
"."/[node, random2, spr]
|
||||||
|
|
||||||
export options
|
export options
|
||||||
|
|||||||
@ -19,8 +19,8 @@
|
|||||||
{.push raises: [].}
|
{.push raises: [].}
|
||||||
|
|
||||||
import
|
import
|
||||||
std/options,
|
std/[net, options],
|
||||||
stint, stew/endians2, stew/shims/net,
|
stint, stew/endians2,
|
||||||
node, lru
|
node, lru
|
||||||
|
|
||||||
export lru
|
export lru
|
||||||
|
|||||||
@ -6,10 +6,10 @@
|
|||||||
#
|
#
|
||||||
import
|
import
|
||||||
chronicles,
|
chronicles,
|
||||||
std/[options, strutils, sugar],
|
results,
|
||||||
pkg/stew/[results, byteutils, arrayops],
|
std/[net, options, strutils, sugar],
|
||||||
|
pkg/stew/[byteutils, arrayops],
|
||||||
stew/endians2,
|
stew/endians2,
|
||||||
stew/shims/net,
|
|
||||||
stew/base64,
|
stew/base64,
|
||||||
libp2p/crypto/crypto,
|
libp2p/crypto/crypto,
|
||||||
libp2p/crypto/secp,
|
libp2p/crypto/secp,
|
||||||
@ -122,9 +122,13 @@ proc update*(
|
|||||||
.mapErr((e: string) => e.cstring)
|
.mapErr((e: string) => e.cstring)
|
||||||
existingIp =
|
existingIp =
|
||||||
if existingNetProtoFam == MultiCodec.codec("ip6"):
|
if existingNetProtoFam == MultiCodec.codec("ip6"):
|
||||||
ipv6 array[16, byte].initCopyFrom(existingNetProtoAddr)
|
IpAddress(
|
||||||
|
family: IPv6, address_v6: array[16, byte].initCopyFrom(existingNetProtoAddr)
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
ipv4 array[4, byte].initCopyFrom(existingNetProtoAddr)
|
IpAddress(
|
||||||
|
family: IPv4, address_v4: array[4, byte].initCopyFrom(existingNetProtoAddr)
|
||||||
|
)
|
||||||
|
|
||||||
ipAddr = ip.get(existingIp)
|
ipAddr = ip.get(existingIp)
|
||||||
|
|
||||||
|
|||||||
@ -6,13 +6,12 @@
|
|||||||
|
|
||||||
# Everything below the handling of ordinary messages
|
# Everything below the handling of ordinary messages
|
||||||
import
|
import
|
||||||
std/[tables, options, sets],
|
std/[net, tables, options, sets],
|
||||||
bearssl/rand,
|
bearssl/rand,
|
||||||
chronos,
|
chronos,
|
||||||
chronicles,
|
chronicles,
|
||||||
metrics,
|
metrics,
|
||||||
libp2p/crypto/crypto,
|
libp2p/crypto/crypto,
|
||||||
stew/shims/net,
|
|
||||||
"."/[node, encoding, sessions]
|
"."/[node, encoding, sessions]
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user