book: fix example (#1348)

This commit is contained in:
Paul 2022-01-27 23:15:25 +01:00 committed by GitHub
parent 16a7dc5dc1
commit aa0ad43810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -31,8 +31,8 @@ If your function requires instruction data, you can add it by adding arguments t
mod hello_anchor {
use super::*;
pub fn set_data(ctx: Context<SetData>, data: Data) -> ProgramResult {
ctx.accounts.my_account.data = init_data.data;
ctx.accounts.my_account.age = init_data.age;
ctx.accounts.my_account.data = data.data;
ctx.accounts.my_account.age = data.age;
Ok(())
}
}