I have a u64 which is an amount of lamports. I need to send it to another program with a CPI. So i'm trying to encode it in the data, but can't figure out how to do it.
Here is what i tried:
let mut instruction_discriminator: Vec<u8> = vec![38, 29, ...];
let mut instruction_data: Vec<u8> = price_in_lamports.to_be_bytes().to_vec();
instruction_discriminator.append(&mut instruction_data);
but then in the programm called thru the CPI, when i log the amount received, it's totally different (wayyyy bigger), so i guess i'm doing something wrong here. Anyone can help ?