use borsh::{BorshSerialize, BorshDeserialize};

#[derive(BorshSerialize, BorshDeserialize, PartialEq, Debug)]
struct A {
    x: u64,
    y: String,
}

fn main() {
    let a = A {
        x: 8964,
        y: "CLTV".to_string()
    };
    let encoded_a: Vec<u8> = a.try_to_vec().unwrap();
    let decoded_a: A = A::try_from_slice(&encoded_a).unwrap();
    println!("{:?}", encoded_a);
    println!("Hello, world! {}", a == decoded_a);
}