12 lines
368 B
Python
Raw Normal View History

2019-12-20 08:41:46 +02:00
from eth2spec.utils import bls
2019-05-15 19:31:02 +02:00
2019-05-30 22:57:18 +02:00
def sign_block_header(spec, state, header, privkey):
domain = spec.get_domain(
2019-05-15 19:31:02 +02:00
state=state,
domain_type=spec.DOMAIN_BEACON_PROPOSER,
)
2020-01-03 07:46:27 +01:00
message = spec.compute_signing_root(header, domain)
2019-12-20 08:41:46 +02:00
signature = bls.Sign(privkey, message)
2019-12-17 12:04:56 +02:00
return spec.SignedBeaconBlockHeader(message=header, signature=signature)