code: func (s *Store) CAProviderState(id string) (uint64, *structs.CAConsulProviderState, error) {
  	tx := s.db.Txn(false)
  	defer tx.Abort()
  
  	// Get the index
  	idx := maxIndexTxn(tx, caBuiltinProviderTableName)
  
  	// Get the provider config
  	c, err := tx.First(caBuiltinProviderTableName, "id", id)
  	if err != nil {
  		return 0, nil, fmt.Errorf("failed built-in CA state lookup: %s", err)
  	}
  
  	state, ok := c.(*structs.CAConsulProviderState)
  	if !ok {
  		return 0, nil, nil
  	}
  
  	return idx, state, nil
  }
docs: // CAProviderState is used to get the Consul CA provider state for the given ID.