diff --git a/beacon_chain/eth2_discovery.nim b/beacon_chain/eth2_discovery.nim index bbdc281cf..0f8712f5b 100644 --- a/beacon_chain/eth2_discovery.nim +++ b/beacon_chain/eth2_discovery.nim @@ -45,7 +45,7 @@ proc toENode*(a: MultiAddress): Result[ENode, cstring] = var pubkey: libp2pCrypto.PublicKey if peerId.extractPublicKey(pubkey): if pubkey.scheme == Secp256k1: - return ok ENode(pubkey: pubkey.skkey, + return ok ENode(pubkey: PublicKey(pubkey.skkey), address: Address(ip: ipAddress, tcpPort: Port tcpPort, udpPort: Port udpPort)) @@ -57,8 +57,8 @@ proc toENode*(a: MultiAddress): Result[ENode, cstring] = return err "Invalid MultiAddress" proc toMultiAddressStr*(enode: ENode): string = - var peerId = PeerID.init(libp2pCrypto.PublicKey(scheme: Secp256k1, - skkey: enode.pubkey)) + var peerId = PeerID.init(libp2pCrypto.PublicKey( + scheme: Secp256k1, skkey: SkPublicKey(enode.pubkey))) &"/ip4/{enode.address.ip}/tcp/{enode.address.tcpPort}/p2p/{peerId.pretty}" proc toENode*(enrRec: enr.Record): Result[ENode, cstring] = diff --git a/beacon_chain/eth2_network.nim b/beacon_chain/eth2_network.nim index 67968a89b..f96d8682e 100644 --- a/beacon_chain/eth2_network.nim +++ b/beacon_chain/eth2_network.nim @@ -610,7 +610,8 @@ proc toPeerInfo*(r: enr.TypedRecord): PeerInfo = if recoverPublicKey(r.secp256k1.get, pubKey) != EthKeysStatus.Success: return # TODO - let peerId = PeerID.init crypto.PublicKey(scheme: Secp256k1, skkey: pubKey) + let peerId = PeerID.init crypto.PublicKey( + scheme: Secp256k1, skkey: SkPublicKey(pubKey)) var addresses = newSeq[MultiAddress]() if r.ip.isSome and r.tcp.isSome: @@ -866,10 +867,10 @@ proc setupNat(conf: BeaconNodeConf): tuple[ip: Option[IpAddress], (result.tcpPort, result.udpPort) = extPorts.get() func asLibp2pKey*(key: keys.PublicKey): PublicKey = - PublicKey(scheme: Secp256k1, skkey: key) + PublicKey(scheme: Secp256k1, skkey: SkPublicKey(key)) func asEthKey*(key: PrivateKey): keys.PrivateKey = - keys.PrivateKey(data: key.skkey.data) + keys.PrivateKey(SkSecretKey(data: key.skkey.data)) proc initAddress*(T: type MultiAddress, str: string): T = let address = MultiAddress.init(str) diff --git a/vendor/nim-eth b/vendor/nim-eth index 5dc0a533b..c827c3732 160000 --- a/vendor/nim-eth +++ b/vendor/nim-eth @@ -1 +1 @@ -Subproject commit 5dc0a533b09fe2a250411c1113a76a4cc3d25b5b +Subproject commit c827c37329541a2f3d7d8057fa577f14537bb832 diff --git a/vendor/nim-stew b/vendor/nim-stew index 4201f4675..86739f99c 160000 --- a/vendor/nim-stew +++ b/vendor/nim-stew @@ -1 +1 @@ -Subproject commit 4201f46750a47d45b6bfc1521f93aaf9cdf1bf0f +Subproject commit 86739f99c4efc1246d45164ef81c1e8f72970b65 diff --git a/vendor/nim-web3 b/vendor/nim-web3 index 89d7a0c8f..da74eabaa 160000 --- a/vendor/nim-web3 +++ b/vendor/nim-web3 @@ -1 +1 @@ -Subproject commit 89d7a0c8fd1eb0f749432bd7136d8f385351c48e +Subproject commit da74eabaa00e2a8f7c58e8d84a02b701041dfc2d