message: Improve protocol version handling in vcx.
diff: @@ -37,6 +37,7 @@ pub static CONFIG_PROTOCOL_VERSION: &'static str = "protocol_version";
  pub static UNINITIALIZED_WALLET_KEY: &str = "<KEY_IS_NOT_SET>";
  pub static UNINITIALIZED_BACKUP_KEY: &str = "<KEY_IS_NOT_SET>";
  pub static DEFAULT_PROTOCOL_VERSION: usize = 1;
  +pub static MAX_SUPPORTED_PROTOCOL_VERSION: usize = 2;
  pub static DEFAULT_GENESIS_PATH: &str = "/tmp/genesis.txn";
  pub static DEFAULT_EXPORTED_WALLET_PATH: &str = "/tmp/wallet.txn";
  pub static DEFAULT_WALLET_NAME: &str = "LIBVCX_SDK_WALLET";
  @@ -186,11 +187,19 @@ pub fn process_config_file(path: &str) -> Result<u32, u32> {
  pub fn get_protocol_version() -> usize {
  let protocol_version = match get_config_value(CONFIG_PROTOCOL_VERSION) {
  - Ok(x) => x.parse::<usize>().unwrap_or(DEFAULT_PROTOCOL_VERSION),
  - Err(x) => DEFAULT_PROTOCOL_VERSION,
  - };
  - if protocol_version > DEFAULT_PROTOCOL_VERSION {
  + Ok(ver) => ver.parse::<usize>().unwrap_or_else(|err| {
  + warn!("Can't parse value of protocol version from config ({}), use default one ({})", err, DEFAULT_PROTOCOL_VERSION);
  + DEFAULT_PROTOCOL_VERSION
  + }),
  + Err(err) => {
  + info!("Can't fetch protocol version from config ({}), use default one ({})", err, DEFAULT_PROTOCOL_VERSION);
  DEFAULT_PROTOCOL_VERSION
  + },
  + };
  + if protocol_version > MAX_SUPPORTED_PROTOCOL_VERSION {
  + error!("Protocol version from config {}, greater then maximal supported {}, use maximum one",
  + protocol_version, MAX_SUPPORTED_PROTOCOL_VERSION);
  + MAX_SUPPORTED_PROTOCOL_VERSION
  } else {
  protocol_version
  }
  