func (api *API) ValidateTicket(from, to hash.Hash, subscriptionID string, t *ticket.Ticket) (*ticket.Ticket, error) {
	data, err := json.Marshal(t.Work.Data.GetWorkProofOutput())
	if err != nil {
		return nil, err
	}

	body, statusCode, err := api.Post(fmt.Sprintf("/ticket/%s", t.ID), data)
	if err != nil {
		return nil, err
	}

	if statusCode < 200 || statusCode > 299 {
		if isErrorResponse(body) {
			return nil, GetErrorFromResponse(body)
		}
		return nil, errNoSuccess
	}

	if isErrorResponse(body) {
		return nil, GetErrorFromResponse(body)
	}

	// Parse body for ticket
	newT, err := ticket.NewFromBytes(body)
	if err != nil {
		return nil, err
	}

	return newT, nil
}
// ValidateTicket will send back a ticket-result
ValidateTicket will send back a ticket-result
// ValidateTicket will send back a ticket - result
func (api *API) ValidateTicket(from, to hash.Hash, subscriptionID string, t *ticket.Ticket) (*ticket.Ticket, error) {
	data, err := json.Marshal(t.Work.Data.GetWorkProofOutput())
	if err != nil {
		return nil, err
	}
	body, statusCode, err := api.Post(fmt.Sprintf("/ticket/%s", t.ID), data)
	if err != nil {
		return nil, err
	}
	if statusCode < 200 || statusCode > 299 {
		if isErrorResponse(body) {
			return nil, GetErrorFromResponse(body)
		}
		return nil, errNoSuccess
	}
	if isErrorResponse(body) {
		return nil, GetErrorFromResponse(body)
	}
	newT, err := ticket.NewFromBytes(body)
	if err != nil {
		return nil, err
	}
	return newT, nil
}
func ( api * API ) ValidateTicket ( from , to hash . Hash , subscriptionID string , t * ticket . Ticket ) ( * ticket . Ticket , error ) { data , err := json . Marshal ( t . Work . Data . GetWorkProofOutput ( ) ) if err != nil { return nil , err } body , statusCode , err := api . Post ( fmt . Sprintf ( " " , t . ID ) , data ) if err != nil { return nil , err } if statusCode < 200 || statusCode > 299 { if isErrorResponse ( body ) { return nil , GetErrorFromResponse ( body ) } return nil , errNoSuccess } if isErrorResponse ( body ) { return nil , GetErrorFromResponse ( body ) } newT , err := ticket . NewFromBytes ( body ) if err != nil { return nil , err } return newT , nil }
ValidateTicket will send back a ticket-result
ValidateTicket will send back a ticket - result
// Parse body for ticket