diff --git a/client/src/hello_world.ts b/client/src/hello_world.ts index cec6783..3e33f9e 100644 --- a/client/src/hello_world.ts +++ b/client/src/hello_world.ts @@ -203,7 +203,7 @@ export async function sayHello(): Promise { const instruction = new TransactionInstruction({ keys: [{pubkey: greetedPubkey, isSigner: false, isWritable: true}], programId, - data: Buffer.from([5]), + data: Buffer.alloc(0), // All instructions are hellos }); await sendAndConfirmTransaction( connection, diff --git a/src/lib.rs b/src/lib.rs index ef8d9fe..79340c6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -40,8 +40,7 @@ pub fn process_instruction( // Increment and store the number of times the account has been greeted let mut greeting_account = GreetingAccount::try_from_slice(&account.data.borrow())?; - let my_param = u32::from(_instruction_data[0]); - greeting_account.counter += my_param; + greeting_account.counter += 1; greeting_account.serialize(&mut &mut account.data.borrow_mut()[..])?; msg!("Greeted {} time(s)!", greeting_account.counter);