@@ -70,6 +70,8 @@ pub enum Error {
7070 InvalidFinalizedBlock ,
7171 BeaconBlockBodyError ,
7272 InconsistentFork ,
73+ // TODO(gloas): implement Gloas light client
74+ GloasNotImplemented ,
7375}
7476
7577impl From < ssz_types:: Error > for Error {
@@ -195,7 +197,8 @@ impl<'de, E: EthSpec> ContextDeserialize<'de, ForkName> for LightClientUpdate<E>
195197 serde:: de:: Error :: custom ( format ! ( "LightClientUpdate failed to deserialize: {:?}" , e) )
196198 } ;
197199 Ok ( match context {
198- ForkName :: Base => {
200+ // TODO(gloas): implement Gloas light client
201+ ForkName :: Base | ForkName :: Gloas => {
199202 return Err ( serde:: de:: Error :: custom ( format ! (
200203 "LightClientUpdate failed to deserialize: unsupported fork '{}'" ,
201204 context
@@ -216,7 +219,6 @@ impl<'de, E: EthSpec> ContextDeserialize<'de, ForkName> for LightClientUpdate<E>
216219 ForkName :: Fulu => {
217220 Self :: Fulu ( Deserialize :: deserialize ( deserializer) . map_err ( convert_err) ?)
218221 }
219- ForkName :: Gloas => todo ! ( "Gloas light client not implemented" ) ,
220222 } )
221223 }
222224}
@@ -371,7 +373,8 @@ impl<E: EthSpec> LightClientUpdate<E> {
371373 // To add a new fork, just append the new fork variant on the latest fork. Forks that
372374 // have a distinct execution header will need a new LightClientUpdate variant only
373375 // if you need to test or support lightclient usages
374- ForkName :: Gloas => todo ! ( "Gloas light client not implemented" ) ,
376+ // TODO(gloas): implement Gloas light client
377+ ForkName :: Gloas => return Err ( Error :: GloasNotImplemented ) ,
375378 } ;
376379
377380 Ok ( light_client_update)
@@ -386,9 +389,8 @@ impl<E: EthSpec> LightClientUpdate<E> {
386389 ForkName :: Deneb => Self :: Deneb ( LightClientUpdateDeneb :: from_ssz_bytes ( bytes) ?) ,
387390 ForkName :: Electra => Self :: Electra ( LightClientUpdateElectra :: from_ssz_bytes ( bytes) ?) ,
388391 ForkName :: Fulu => Self :: Fulu ( LightClientUpdateFulu :: from_ssz_bytes ( bytes) ?) ,
389- ForkName :: Gloas => todo ! ( "Gloas light client not implemented" ) ,
390-
391- ForkName :: Base => {
392+ // TODO(gloas): implement Gloas light client
393+ ForkName :: Base | ForkName :: Gloas => {
392394 return Err ( ssz:: DecodeError :: BytesInvalid ( format ! (
393395 "LightClientUpdate decoding for {fork_name} not implemented"
394396 ) ) ) ;
@@ -535,7 +537,8 @@ impl<E: EthSpec> LightClientUpdate<E> {
535537 ForkName :: Deneb => <LightClientUpdateDeneb < E > as Encode >:: ssz_fixed_len ( ) ,
536538 ForkName :: Electra => <LightClientUpdateElectra < E > as Encode >:: ssz_fixed_len ( ) ,
537539 ForkName :: Fulu => <LightClientUpdateFulu < E > as Encode >:: ssz_fixed_len ( ) ,
538- ForkName :: Gloas => todo ! ( "Gloas light client not implemented" ) ,
540+ // TODO(gloas): implement Gloas light client
541+ ForkName :: Gloas => 0 ,
539542 } ;
540543 fixed_len + 2 * LightClientHeader :: < E > :: ssz_max_var_len_for_fork ( fork_name)
541544 }
0 commit comments