func (ca *CAServer) storedOrder(i string) (*order, error) {
	idx, err := strconv.Atoi(i)
	if err != nil {
		return nil, fmt.Errorf("storedOrder: %v", err)
	}
	if idx < 0 {
		return nil, fmt.Errorf("storedOrder: invalid order index %d", idx)
	}
	if idx > len(ca.orders)-1 {
		return nil, fmt.Errorf("storedOrder: no such order %d", idx)
	}
	return ca.orders[idx], nil
}
// storedOrder retrieves a previously created order at index i.
// It requires ca.mu to be locked.
storedOrder retrieves a previously created order at index i.
It requires ca.mu to be locked.
// storedOrder retrieves a previously created order at index i . // It requires ca . mu to be locked .
func (ca *CAServer) storedOrder(i string) (*order, error) {
	idx, err := strconv.Atoi(i)
	if err != nil {
		return nil, fmt.Errorf("storedOrder: %v", err)
	}
	if idx < 0 {
		return nil, fmt.Errorf("storedOrder: invalid order index %d", idx)
	}
	if idx > len(ca.orders)-1 {
		return nil, fmt.Errorf("storedOrder: no such order %d", idx)
	}
	return ca.orders[idx], nil
}
func ( ca * CAServer ) storedOrder ( i string ) ( * order , error ) { idx , err := strconv . Atoi ( i ) if err != nil { return nil , fmt . Errorf ( " " , err ) } if idx < 0 { return nil , fmt . Errorf ( " " , idx ) } if idx > len ( ca . orders ) - 1 { return nil , fmt . Errorf ( " " , idx ) } return ca . orders [ idx ] , nil }
storedOrder retrieves a previously created order at index i.
storedOrder retrieves a previously created order at index i .