Anymore has some resources or something on how to implement borsh deserialization for Solana instruction data? I'm having the issue that I don't know the length so I get an error when trying to call try_from_slice any way on how to call the try_from_slice_unchecked.
Lets take this as a minimal example:
#[derive(BorshSchema, BorshDeserialize, Debug)]
struct Payload {
purchase_qty: u64,
expected_price: u64,
seller: String,
}
let (&tag, rest) = input.split_first().ok_or(Error::Unexpected(format!("Invalid Instruction")))?;
let data = Payload::try_from_slice(rest).unwrap();
where the last command fails with the following input data
70c23f6334935530e803000000000000ff47030000000000057a4e3d6acf2f5218f24947801d10baadcc78e1abf15d838e0b4f46d6013288
i know there is the function try_from_slice_unchecked
but its only available inside the solana-crates can i somehow implement it also or parse the instruction-data more generic
?