Skip to content

Commit

Permalink
Bump nim-eth for Opt changes and make Opt related adjustments (#6369)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeme authored Jun 18, 2024
1 parent cb2c379 commit 7a8c1d8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion beacon_chain/networking/eth2_discovery.nim
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ proc loadBootstrapFile*(bootstrapFile: string,

proc new*(T: type Eth2DiscoveryProtocol,
config: BeaconNodeConf | LightClientConf,
enrIp: Option[IpAddress], enrTcpPort, enrUdpPort: Option[Port],
enrIp: Opt[IpAddress], enrTcpPort, enrUdpPort: Opt[Port],
pk: PrivateKey,
enrFields: openArray[(string, seq[byte])], rng: ref HmacDrbgContext):
T =
Expand Down
2 changes: 1 addition & 1 deletion beacon_chain/networking/eth2_network.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,7 @@ proc new(T: type Eth2Node,
enrForkId: ENRForkID, discoveryForkId: ENRForkID,
forkDigests: ref ForkDigests, getBeaconTime: GetBeaconTimeFn,
switch: Switch, pubsub: GossipSub,
ip: Option[IpAddress], tcpPort, udpPort: Option[Port],
ip: Opt[IpAddress], tcpPort, udpPort: Opt[Port],
privKey: keys.PrivateKey, discovery: bool,
directPeers: DirectPeers,
rng: ref HmacDrbgContext): T {.raises: [CatchableError].} =
Expand Down
6 changes: 3 additions & 3 deletions beacon_chain/nimbus_beacon_node.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2271,9 +2271,9 @@ proc doRecord(config: BeaconNodeConf, rng: var HmacDrbgContext) {.
let record = enr.Record.init(
config.seqNumber,
netKeys.seckey.asEthKey,
some(config.ipExt),
some(config.tcpPortExt),
some(config.udpPortExt),
Opt.some(config.ipExt),
Opt.some(config.tcpPortExt),
Opt.some(config.udpPortExt),
fieldPairs).expect("Record within size limits")

echo record.toURI()
Expand Down
6 changes: 3 additions & 3 deletions ncli/ncli_testnet.nim
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@ proc createEnr(rng: var HmacDrbgContext,
bootstrapEnr = enr.Record.init(
1, # sequence number
networkKeys.seckey.asEthKey,
some(address),
some(port),
some(port),
Opt.some(address),
Opt.some(port),
Opt.some(port),
[
toFieldPair(enrForkIdField, forkId),
toFieldPair(enrAttestationSubnetsField, SSZ.encode(netMetadata.attnets))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_discovery.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import

proc new(T: type Eth2DiscoveryProtocol,
pk: keys.PrivateKey,
enrIp: Option[IpAddress], enrTcpPort, enrUdpPort: Option[Port],
enrIp: Opt[IpAddress], enrTcpPort, enrUdpPort: Opt[Port],
bindPort: Port, bindIp: IpAddress,
enrFields: openArray[(string, seq[byte])] = [],
rng: ref HmacDrbgContext): T =
Expand All @@ -32,7 +32,7 @@ proc generateNode(rng: ref HmacDrbgContext, port: Port,
except ValueError:
raiseAssert "Argument is a valid IP address"
Eth2DiscoveryProtocol.new(keys.PrivateKey.random(rng[]),
some(ip), some(port), some(port), port, ip, enrFields, rng = rng)
Opt.some(ip), Opt.some(port), Opt.some(port), port, ip, enrFields, rng = rng)

# TODO: Add tests with a syncnets preference
const noSyncnetsPreference = SyncnetBits()
Expand Down

0 comments on commit 7a8c1d8

Please sign in to comment.