Not using deprecated functions in config anymore (#2495)

This commit is contained in:
andri lim 2024-07-17 09:57:19 +07:00 committed by GitHub
parent a84a2131cd
commit a59cc84fca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 5 deletions

View File

@ -148,7 +148,7 @@ type
desc: "Directory where era1 (pre-merge) archive can be found"
defaultValueDesc: "<data-dir>/era1"
name: "era1-dir" }: Option[OutDir]
eraDirOpt* {.
desc: "Directory where era (post-merge) archive can be found"
defaultValueDesc: "<data-dir>/era"
@ -558,7 +558,7 @@ func completeCmdArg(T: type NetworkId, val: string): seq[string] =
return @[]
func parseCmdArg*(T: type enr.Record, p: string): T {.raises: [ValueError].} =
if not fromURI(result, p):
result = fromURI(enr.Record, p).valueOr:
raise newException(ValueError, "Invalid ENR")
func completeCmdArg*(T: type enr.Record, val: string): seq[string] =
@ -704,7 +704,7 @@ func fromEnr*(T: type ENode, r: enr.Record): ENodeResult[ENode] =
# could have been done and no Record would exist here.
# TypedRecord should be reworked not to have public key as an option.
pk = r.get(PublicKey).get()
tr = r.toTypedRecord().expect("id in valid record")
tr = TypedRecord.fromRecord(r)#.expect("id in valid record")
if tr.ip.isNone():
return err(IncorrectIP)

View File

@ -300,7 +300,6 @@ proc deblobify*(
if record.len < 11: # at least two edges
return err(DeblobBranchTooShort)
let
sLen = record[^1].int and 0x3f # length of path segment aInx = record.len - 9
aInx = record.len - 9
aIny = record.len - 2
var

View File

@ -10,7 +10,7 @@
import
../../core_db,
"."/[api_tracking, base_config, base_desc]
"."/[base_config, base_desc]
# ------------------------------------------------------------------------------
# Public constructor helper