File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -40,21 +40,24 @@ impl VoluntaryExit {
4040 genesis_validators_root : Hash256 ,
4141 spec : & ChainSpec ,
4242 ) -> SignedVoluntaryExit {
43+ let domain = self . get_domain ( genesis_validators_root, spec) ;
44+
45+ let message = self . signing_root ( domain) ;
46+ SignedVoluntaryExit {
47+ message : self ,
48+ signature : secret_key. sign ( message) ,
49+ }
50+ }
51+
52+ pub fn get_domain ( & self , genesis_validators_root : Hash256 , spec : & ChainSpec ) -> Hash256 {
4353 let fork_name = spec. fork_name_at_epoch ( self . epoch ) ;
4454 let fork_version = if fork_name. deneb_enabled ( ) {
4555 // EIP-7044
4656 spec. fork_version_for_name ( ForkName :: Capella )
4757 } else {
4858 spec. fork_version_for_name ( fork_name)
4959 } ;
50- let domain =
51- spec. compute_domain ( Domain :: VoluntaryExit , fork_version, genesis_validators_root) ;
52-
53- let message = self . signing_root ( domain) ;
54- SignedVoluntaryExit {
55- message : self ,
56- signature : secret_key. sign ( message) ,
57- }
60+ spec. compute_domain ( Domain :: VoluntaryExit , fork_version, genesis_validators_root)
5861 }
5962}
6063
You can’t perform that action at this time.
0 commit comments