message: Use new ocaml-interop variant mapping macro
diff: @@ -12,7 +12,8 @@ use crate::ffi::{
  use crypto::hash::{BlockHash, ContextHash, Hash, OperationHash, ProtocolHash};
  use tezos_messages::p2p::encoding::operations_for_blocks::{Path, PathLeft, PathRight};
  use znfe::{
  - impl_from_ocaml_record, FromOCaml, IntoRust, OCaml, OCamlBytes, OCamlInt, OCamlInt32, OCamlList,
  + impl_from_ocaml_record, ocaml_unpack_variant, FromOCaml, IntoRust, OCaml, OCamlBytes, OCamlInt,
  + OCamlInt32, OCamlList,
  };
  macro_rules! from_ocaml_hash {
  @@ -106,34 +107,31 @@ impl_from_ocaml_record! {
  // TODO: remove this after TE-207 has been solved
  unsafe impl FromOCaml<Path> for FfiPath {
  fn from_ocaml(v: OCaml<Path>) -> Self {
  - if v.is_long() {
  - FfiPath(Path::Op)
  - } else {
  - match v.tag_value() {
  - 0 => {
  - let path: FfiPath = unsafe { v.field::<Path>(0).into_rust() };
  - let right = unsafe { v.field::<OCamlHash>(1).into_rust() };
  -
  - FfiPath(Path::Left(Box::new(PathLeft::new(
  + let result = ocaml_unpack_variant! {
  + v => {
  + Left(path: Path, right: OCamlHash) => {
  + let path: FfiPath = path;
  + FfiPath(
  + Path::Left(
  + Box::new(
  + PathLeft::new(
  path.0,
  right,
  - Default::default(),
  - ))))
  - }
  - 1 => {
  - let left = unsafe { v.field::<OCamlHash>(0).into_rust() };
  - let path: FfiPath = unsafe { v.field::<Path>(1).into_rust() };
  -
  - FfiPath(Path::Right(Box::new(PathRight::new(
  + Default::default()))))
  + },
  + Right(left: OCamlHash, path: Path) => {
  + let path: FfiPath = path;
  + FfiPath(
  + Path::Right(
  + Box::new(
  + PathRight::new(
  left,
  path.0,
  - Default::default(),
  - ))))
  - }
  - // NOTE: this will not happen *unless* the memory representation of
  - // the `Path` type on the tezos side changes.
  - tag => panic!("Invalid tag value for OCaml<Path>, the memory representation of the `Path` may have changed: {}", tag),
  - }
  + Default::default()))))
  + },
  + Op => FfiPath(Path::Op),
  }
  + };
  + result.unwrap()
  }
  }
  