Closed ChiefWoods closed 4 months ago
This is the code/test run for number 12: https://github.com/freeCodeCamp/solana-curriculum/blob/7485d98f6a46f44b0f684e1c1d3facbd730c3df8/build-a-smart-contract/program/tests/process_instruction.rs#L35-L55
I think we resolved this on Discord?
The issue is:
let mut message_account =
MessageAccount::try_from_slice(instruction_data).map_err(|_| {
msg!("Message is not valid");
ProgramError::InvalidInstructionData
})?;
because instruction_data
is not a serialized MessageAccount
- therefore, it cannot be deserialized into one.
Project
Build-A-Smart-Contract
Lesson Number
Question
I've tried many modifications and just can't get test #12 to pass, even if the message is successfully stored on the program's data.
Code and Screenshots
lib.rs
main.js
message.js