11 lines
374 B
Python
Raw Normal View History

2019-12-17 12:04:56 +02:00
from eth2spec.utils.bls import Sign
2019-05-15 19:31:02 +02:00
2019-05-30 22:57:18 +02:00
def sign_voluntary_exit(spec, state, voluntary_exit, privkey):
2019-12-17 12:04:56 +02:00
domain = spec.get_domain(state, spec.DOMAIN_VOLUNTARY_EXIT, voluntary_exit.epoch)
message = spec.compute_domain_wrapper_root(voluntary_exit, domain)
2019-11-21 23:13:45 +01:00
return spec.SignedVoluntaryExit(
message=voluntary_exit,
2019-12-17 12:04:56 +02:00
signature=Sign(privkey, message)
2019-05-15 18:36:32 +02:00
)