mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-13 02:56:24 +00:00
18 lines
597 B
Python
18 lines
597 B
Python
from copy import deepcopy
|
|
|
|
from eth2spec.phase0.spec import AttesterSlashing, convert_to_indexed
|
|
from eth2spec.test.helpers.attestations import get_valid_attestation, make_attestation_signature
|
|
|
|
|
|
def get_valid_attester_slashing(state):
|
|
attestation_1 = get_valid_attestation(state)
|
|
attestation_2 = deepcopy(attestation_1)
|
|
attestation_2.data.target_root = b'\x01' * 32
|
|
|
|
make_attestation_signature(state, attestation_2)
|
|
|
|
return AttesterSlashing(
|
|
attestation_1=convert_to_indexed(state, attestation_1),
|
|
attestation_2=convert_to_indexed(state, attestation_2),
|
|
)
|