@api_request
@reply_type([ProtocolMessageTypes.respond_signage_point, ProtocolMessageTypes.respond_end_of_sub_slot])
async def request_signage_point_or_end_of_sub_slot(self, request: full_node_protocol.RequestSignagePointOrEndOfSubSlot) -> Optional[Message]:
    if (request.index_from_challenge == 0):
        sub_slot: Optional[Tuple[(EndOfSubSlotBundle, int, uint128)]] = self.full_node.full_node_store.get_sub_slot(request.challenge_hash)
        if (sub_slot is not None):
            return make_msg(ProtocolMessageTypes.respond_end_of_sub_slot, full_node_protocol.RespondEndOfSubSlot(sub_slot[0]))
    else:
        if (self.full_node.full_node_store.get_sub_slot(request.challenge_hash) is None):
            if (request.challenge_hash != self.full_node.constants.GENESIS_CHALLENGE):
                self.log.info(f"Don't have challenge hash {request.challenge_hash}")
        sp: Optional[SignagePoint] = self.full_node.full_node_store.get_signage_point_by_index(request.challenge_hash, request.index_from_challenge, request.last_rc_infusion)
        if (sp is not None):
            assert ((sp.cc_vdf is not None) and (sp.cc_proof is not None) and (sp.rc_vdf is not None) and (sp.rc_proof is not None))
            full_node_response = full_node_protocol.RespondSignagePoint(request.index_from_challenge, sp.cc_vdf, sp.cc_proof, sp.rc_vdf, sp.rc_proof)
            return make_msg(ProtocolMessageTypes.respond_signage_point, full_node_response)
        else:
            self.log.info(f"Don't have signage point {request}")
    return None
@api_request
@reply_type([ProtocolMessageTypes.respond_signage_point, ProtocolMessageTypes.respond_end_of_sub_slot])
async def request_signage_point_or_end_of_sub_slot(self, request: full_node_protocol.RequestSignagePointOrEndOfSubSlot) -> Optional[Message]:
    if (request.index_from_challenge == 0):
        sub_slot: Optional[Tuple[(EndOfSubSlotBundle, int, uint128)]] = self.full_node.full_node_store.get_sub_slot(request.challenge_hash)
        if (sub_slot is not None):
            return make_msg(ProtocolMessageTypes.respond_end_of_sub_slot, full_node_protocol.RespondEndOfSubSlot(sub_slot[0]))
    else:
        if (self.full_node.full_node_store.get_sub_slot(request.challenge_hash) is None):
            if (request.challenge_hash != self.full_node.constants.GENESIS_CHALLENGE):
                self.log.info(f"Don't have challenge hash {request.challenge_hash}")
        sp: Optional[SignagePoint] = self.full_node.full_node_store.get_signage_point_by_index(request.challenge_hash, request.index_from_challenge, request.last_rc_infusion)
        if (sp is not None):
            assert ((sp.cc_vdf is not None) and (sp.cc_proof is not None) and (sp.rc_vdf is not None) and (sp.rc_proof is not None))
            full_node_response = full_node_protocol.RespondSignagePoint(request.index_from_challenge, sp.cc_vdf, sp.cc_proof, sp.rc_vdf, sp.rc_proof)
            return make_msg(ProtocolMessageTypes.respond_signage_point, full_node_response)
        else:
            self.log.info(f"Don't have signage point {request}")
    return None