9
9
10
10
import
11
11
# Standard library
12
- std/ [algorithm, math, parseutils, strformat, strutils, typetraits, unicode,
13
- uri, hashes],
12
+ std/ [strformat, strutils, typetraits, unicode, uri, hashes],
14
13
# Third-party libraries
15
14
normalize,
16
15
# Status libraries
@@ -24,6 +23,10 @@ import
24
23
libp2p/ crypto/ crypto as lcrypto,
25
24
./ datatypes/ base, ./ signatures
26
25
26
+ from std/ algorithm import binarySearch
27
+ from std/ math import `^`
28
+ from std/ parseutils import parseBiggestUInt
29
+
27
30
export base, uri, io2, options
28
31
29
32
# We use `ncrutils` for constant-time hexadecimal encoding/decoding procedures.
150
153
ProvenProperty * = object
151
154
path* : string
152
155
description* : Option [string ]
153
- denebIndex* : Option [ GeneralizedIndex ]
154
- electraIndex* : Option [ GeneralizedIndex ]
155
- fuluIndex* : Option [ GeneralizedIndex ]
156
+ denebIndex* : GeneralizedIndex
157
+ electraIndex* : GeneralizedIndex
158
+ fuluIndex* : GeneralizedIndex
156
159
157
160
KeystoreData * = object
158
161
version* : uint64
@@ -729,15 +732,15 @@ func parseProvenBlockProperty*(propertyPath: string): Result[ProvenProperty, str
729
732
debugFuluComment " We don't know yet if `GeneralizedIndex` will stay same in Fulu yet."
730
733
ok ProvenProperty (
731
734
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 ))
735
738
elif propertyPath == " .graffiti" :
736
739
ok ProvenProperty (
737
740
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 ))
741
744
else :
742
745
err (" Keystores with proven properties different than " &
743
746
" `.execution_payload.fee_recipient` and `.graffiti` " &
@@ -844,13 +847,13 @@ proc readValue*(reader: var JsonReader, value: var RemoteKeystore)
844
847
var provenProperties = reader.readValue (seq [ProvenProperty ])
845
848
for prop in provenProperties.mitems:
846
849
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 )
850
853
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 )
854
857
else :
855
858
reader.raiseUnexpectedValue (" Keystores with proven properties different than " &
856
859
" `.execution_payload.fee_recipient` and `.graffiti` " &
0 commit comments