casper-execution-engine 1.3.4

Casper execution engine crates.
Documentation
use std::fmt;

use serde::{Deserialize, Serialize};

#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
pub struct TypeMismatch {
    pub expected: String,
    pub found: String,
}

impl fmt::Display for TypeMismatch {
    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
        write!(
            f,
            "Type mismatch. Expected {} but found {}.",
            self.expected, self.found
        )
    }
}

impl TypeMismatch {
    pub fn new(expected: String, found: String) -> TypeMismatch {
        TypeMismatch { expected, found }
    }
}