File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ pub enum Error {
2828 Web3SignerJsonParsingFailed ( String ) ,
2929 ShuttingDown ,
3030 TokioJoin ( String ) ,
31+ MergeForkNotSupported ,
3132}
3233
3334/// Enumerates all messages that can be signed by a validator.
@@ -158,7 +159,7 @@ impl SigningMethod {
158159 SignableMessage :: RandaoReveal ( epoch) => {
159160 Web3SignerObject :: RandaoReveal { epoch }
160161 }
161- SignableMessage :: BeaconBlock ( block) => Web3SignerObject :: beacon_block ( block) ,
162+ SignableMessage :: BeaconBlock ( block) => Web3SignerObject :: beacon_block ( block) ? ,
162163 SignableMessage :: AttestationData ( a) => Web3SignerObject :: Attestation ( a) ,
163164 SignableMessage :: SignedAggregateAndProof ( a) => {
164165 Web3SignerObject :: AggregateAndProof ( a)
Original file line number Diff line number Diff line change 11//! Contains the types required to make JSON requests to Web3Signer servers.
22
3+ use super :: Error ;
34use serde:: { Deserialize , Serialize } ;
45use types:: * ;
56
@@ -66,13 +67,14 @@ pub enum Web3SignerObject<'a, T: EthSpec> {
6667}
6768
6869impl < ' a , T : EthSpec > Web3SignerObject < ' a , T > {
69- pub fn beacon_block ( block : & ' a BeaconBlock < T > ) -> Self {
70+ pub fn beacon_block ( block : & ' a BeaconBlock < T > ) -> Result < Self , Error > {
7071 let version = match block {
7172 BeaconBlock :: Base ( _) => ForkName :: Phase0 ,
7273 BeaconBlock :: Altair ( _) => ForkName :: Altair ,
74+ BeaconBlock :: Merge ( _) => return Err ( Error :: MergeForkNotSupported ) ,
7375 } ;
7476
75- Web3SignerObject :: BeaconBlock { version, block }
77+ Ok ( Web3SignerObject :: BeaconBlock { version, block } )
7678 }
7779
7880 pub fn message_type ( & self ) -> MessageType {
You can’t perform that action at this time.
0 commit comments