99
1010import
1111 # Standard library
12- std/ [algorithm, math, parseutils, strformat, strutils, typetraits, unicode,
13- uri, hashes],
12+ std/ [strformat, strutils, typetraits, unicode, uri, hashes],
1413 # Third-party libraries
1514 normalize,
1615 # Status libraries
@@ -24,6 +23,10 @@ import
2423 libp2p/ crypto/ crypto as lcrypto,
2524 ./ datatypes/ base, ./ signatures
2625
26+ from std/ algorithm import binarySearch
27+ from std/ math import `^`
28+ from std/ parseutils import parseBiggestUInt
29+
2730export base, uri, io2, options
2831
2932# We use `ncrutils` for constant-time hexadecimal encoding/decoding procedures.
150153 ProvenProperty * = object
151154 path* : string
152155 description* : Option [string ]
153- denebIndex* : Option [ GeneralizedIndex ]
154- electraIndex* : Option [ GeneralizedIndex ]
155- fuluIndex* : Option [ GeneralizedIndex ]
156+ denebIndex* : GeneralizedIndex
157+ electraIndex* : GeneralizedIndex
158+ fuluIndex* : GeneralizedIndex
156159
157160 KeystoreData * = object
158161 version* : uint64
@@ -729,15 +732,15 @@ func parseProvenBlockProperty*(propertyPath: string): Result[ProvenProperty, str
729732 debugFuluComment " We don't know yet if `GeneralizedIndex` will stay same in Fulu yet."
730733 ok ProvenProperty (
731734 path: propertyPath,
732- denebIndex: some GeneralizedIndex (801 ),
733- electraIndex: some GeneralizedIndex (801 ),
734- fuluIndex: some GeneralizedIndex (801 ))
735+ denebIndex: GeneralizedIndex (801 ),
736+ electraIndex: GeneralizedIndex (801 ),
737+ fuluIndex: GeneralizedIndex (801 ))
735738 elif propertyPath == " .graffiti" :
736739 ok ProvenProperty (
737740 path: propertyPath,
738- denebIndex: some GeneralizedIndex (18 ),
739- electraIndex: some GeneralizedIndex (18 ),
740- fuluIndex: some GeneralizedIndex (18 ))
741+ denebIndex: GeneralizedIndex (18 ),
742+ electraIndex: GeneralizedIndex (18 ),
743+ fuluIndex: GeneralizedIndex (18 ))
741744 else :
742745 err (" Keystores with proven properties different than " &
743746 " `.execution_payload.fee_recipient` and `.graffiti` " &
@@ -844,13 +847,13 @@ proc readValue*(reader: var JsonReader, value: var RemoteKeystore)
844847 var provenProperties = reader.readValue (seq [ProvenProperty ])
845848 for prop in provenProperties.mitems:
846849 if prop.path == " .execution_payload.fee_recipient" :
847- prop.denebIndex = some GeneralizedIndex (801 )
848- prop.electraIndex = some GeneralizedIndex (801 )
849- prop.fuluIndex = some GeneralizedIndex (801 )
850+ prop.denebIndex = GeneralizedIndex (801 )
851+ prop.electraIndex = GeneralizedIndex (801 )
852+ prop.fuluIndex = GeneralizedIndex (801 )
850853 elif prop.path == " .graffiti" :
851- prop.denebIndex = some GeneralizedIndex (18 )
852- prop.electraIndex = some GeneralizedIndex (18 )
853- prop.fuluIndex = some GeneralizedIndex (18 )
854+ prop.denebIndex = GeneralizedIndex (18 )
855+ prop.electraIndex = GeneralizedIndex (18 )
856+ prop.fuluIndex = GeneralizedIndex (18 )
854857 else :
855858 reader.raiseUnexpectedValue (" Keystores with proven properties different than " &
856859 " `.execution_payload.fee_recipient` and `.graffiti` " &
0 commit comments