mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-17 13:06:34 +00:00
Fix _get_sync_committee_signature helper. Should have used target_slot
This commit is contained in:
parent
fa3e017b65
commit
cb008f2c1a
@ -4,7 +4,7 @@ from eth2spec.utils.ssz.ssz_typing import Bitvector
|
|||||||
from eth2spec.test.helpers.block import build_empty_block
|
from eth2spec.test.helpers.block import build_empty_block
|
||||||
from eth2spec.test.helpers.keys import pubkey_to_privkey
|
from eth2spec.test.helpers.keys import pubkey_to_privkey
|
||||||
from eth2spec.test.helpers.state import transition_to
|
from eth2spec.test.helpers.state import transition_to
|
||||||
from eth2spec.utils import bls
|
from eth2spec.test.helpers.sync_committee import compute_sync_committee_signature
|
||||||
from eth2spec.utils.bls import only_with_bls
|
from eth2spec.utils.bls import only_with_bls
|
||||||
from eth2spec.test.context import (
|
from eth2spec.test.context import (
|
||||||
with_altair_and_later,
|
with_altair_and_later,
|
||||||
@ -85,12 +85,9 @@ def _get_sync_committee_signature(
|
|||||||
pubkey = state.current_sync_committee.pubkeys[sync_committee_index]
|
pubkey = state.current_sync_committee.pubkeys[sync_committee_index]
|
||||||
privkey = pubkey_to_privkey[pubkey]
|
privkey = pubkey_to_privkey[pubkey]
|
||||||
|
|
||||||
domain = spec.get_domain(
|
return compute_sync_committee_signature(
|
||||||
state,
|
spec, state, target_slot, privkey, block_root=target_block_root
|
||||||
spec.DOMAIN_SYNC_COMMITTEE,
|
|
||||||
)
|
)
|
||||||
signing_data = spec.compute_signing_root(target_block_root, domain)
|
|
||||||
return bls.Sign(privkey, spec.hash_tree_root(signing_data))
|
|
||||||
|
|
||||||
|
|
||||||
@only_with_bls()
|
@only_with_bls()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user