When gold was discovered in California it was still officially Mexican territory.