File tree 1 file changed +11
-7
lines changed
1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -40,21 +40,25 @@ impl VoluntaryExit {
40
40
genesis_validators_root : Hash256 ,
41
41
spec : & ChainSpec ,
42
42
) -> 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 {
43
53
let fork_name = spec. fork_name_at_epoch ( self . epoch ) ;
44
54
let fork_version = if fork_name. deneb_enabled ( ) {
45
55
// EIP-7044
46
56
spec. fork_version_for_name ( ForkName :: Capella )
47
57
} else {
48
58
spec. fork_version_for_name ( fork_name)
49
59
} ;
50
- let domain =
51
- spec. compute_domain ( Domain :: VoluntaryExit , fork_version, genesis_validators_root) ;
52
60
53
- let message = self . signing_root ( domain) ;
54
- SignedVoluntaryExit {
55
- message : self ,
56
- signature : secret_key. sign ( message) ,
57
- }
61
+ spec. compute_domain ( Domain :: VoluntaryExit , fork_version, genesis_validators_root)
58
62
}
59
63
}
60
64
You can’t perform that action at this time.
0 commit comments