Rise In Logo

Build on Solana

Solana Task I

Task: Implement the "Reset" Instruction to the already existing codebase

  • Open the existing codebase and navigate to the HelloInstruction enum definition.
  • Add a new variant called "Reset" to the HelloInstruction enum, representing the reset operation. It should be assigned a unique value that is not already used by the other variants.
  • Update the HelloInstruction::unpack method to handle the new "Reset" variant. Assign the new variant a byte value that matches the value assigned in the enum definition.
  • Implement the logic for the "Reset" instruction in the process_instruction function. When the "Reset" variant is encountered, set the counter of the GreetingAccount struct to 0.
  • In the same process_instruction function, add a match arm for the "Reset" variant to handle the reset logic.
  • Open the test module and add a new test case function to the module, specifically for testing the "Reset" instruction.
  • Assert that the counter value of the GreetingAccount struct in the account data is reset to 0 after executing the "Reset" instruction.
  • Run the test suite and ensure that all existing tests pass.


Rise In Logo

Rise together in web3


BootcampsMembersPartner with UsBlogEvents


About UsFAQTerms ConditionsPrivacy PolicyGDPR NoticeCookies