def create_mock_slashable_attestation(state: BeaconState, config: Eth2Config, keymap: Dict[(BLSPubkey, int)], attestation_slot: Slot) -> IndexedAttestation:
    '\n    Create an `IndexedAttestation` that is signed by one attester.\n    '
    attester_index = ValidatorIndex(0)
    committee = (attester_index,)
    shard = Shard(0)
    beacon_block_root = get_block_root_at_slot(state, attestation_slot, config.SLOTS_PER_HISTORICAL_ROOT)
    target_root = _get_target_root(state, config, beacon_block_root)
    source_root = get_block_root_at_slot(state, compute_start_slot_of_epoch(state.current_justified_checkpoint.epoch, config.SLOTS_PER_EPOCH), config.SLOTS_PER_HISTORICAL_ROOT)
    previous_crosslink = state.current_crosslinks[shard]
    attestation_data = AttestationData(beacon_block_root=beacon_block_root, source=Checkpoint(epoch=state.current_justified_checkpoint.epoch, root=source_root), target=Checkpoint(epoch=compute_epoch_of_slot(attestation_slot, config.SLOTS_PER_EPOCH), root=target_root), crosslink=previous_crosslink)
    (message_hash, attesting_indices) = _get_mock_message_and_attesting_indices(attestation_data, committee, num_voted_attesters=1)
    signature = sign_transaction(message_hash=message_hash, privkey=keymap[state.validators[attesting_indices[0]].pubkey], state=state, slot=attestation_slot, signature_domain=SignatureDomain.DOMAIN_ATTESTATION, slots_per_epoch=config.SLOTS_PER_EPOCH)
    validator_indices = tuple((committee[i] for i in attesting_indices))
    return IndexedAttestation(custody_bit_0_indices=validator_indices, custody_bit_1_indices=tuple(), data=attestation_data, signature=signature)
Create an `IndexedAttestation` that is signed by one attester.
def create_mock_slashable_attestation(state: BeaconState, config: Eth2Config, keymap: Dict[(BLSPubkey, int)], attestation_slot: Slot) -> IndexedAttestation:
    '\n    \n    '
    attester_index = ValidatorIndex(0)
    committee = (attester_index,)
    shard = Shard(0)
    beacon_block_root = get_block_root_at_slot(state, attestation_slot, config.SLOTS_PER_HISTORICAL_ROOT)
    target_root = _get_target_root(state, config, beacon_block_root)
    source_root = get_block_root_at_slot(state, compute_start_slot_of_epoch(state.current_justified_checkpoint.epoch, config.SLOTS_PER_EPOCH), config.SLOTS_PER_HISTORICAL_ROOT)
    previous_crosslink = state.current_crosslinks[shard]
    attestation_data = AttestationData(beacon_block_root=beacon_block_root, source=Checkpoint(epoch=state.current_justified_checkpoint.epoch, root=source_root), target=Checkpoint(epoch=compute_epoch_of_slot(attestation_slot, config.SLOTS_PER_EPOCH), root=target_root), crosslink=previous_crosslink)
    (message_hash, attesting_indices) = _get_mock_message_and_attesting_indices(attestation_data, committee, num_voted_attesters=1)
    signature = sign_transaction(message_hash=message_hash, privkey=keymap[state.validators[attesting_indices[0]].pubkey], state=state, slot=attestation_slot, signature_domain=SignatureDomain.DOMAIN_ATTESTATION, slots_per_epoch=config.SLOTS_PER_EPOCH)
    validator_indices = tuple((committee[i] for i in attesting_indices))
    return IndexedAttestation(custody_bit_0_indices=validator_indices, custody_bit_1_indices=tuple(), data=attestation_data, signature=signature)