user-avatar
R
Rish21
Joined
icon image
Internet Computer
0 REP
2 Feedbacks
1 predaji zadatka

Submissions

Submitted

I use the current module as a template where I made it more featuring a more modular approach, error handling improvements, and an enhanced storage mechanism using a custom data structure for efficient message management. Also add a test file to run the tests and utilise all the features of the contract

30Points
4 Feedbacks

FEEDBACK

86.5 REP
Submitted

### Secret Diary App **Project Summary:** This project lets you keep your personal messages private by encrypting them with a secret key, ensuring that only you can read them. It's like having a digital diary with a lock and key to protect your thoughts and memories on the ICP blockchain.

50Points
4 Feedbacks
Feedback

#Hello OT41K! I hope this message finds you well This enhancement aims to provide users with more control over their messages by enabling updates. The improvements in error handling contribute to a more resilient and user-friendly experience.

##Changes Made:

###New Feature: Update Message Added a new function update_message to allow users with the "admin" role to update existing messages.

###Improved do_insert Function: Enhanced the do_insert function with error handling, returning a Result<(), Error> to handle potential insertion failures. This ensures more robust and reliable data insertion.

###Access Control for Updating Messages: Implemented access control checks in the update_message function to ensure that only users with the "admin" role and the correct secret key can update messages.

###New Error Variant: InsertFailed Introduced a new error variant InsertFailed to handle cases where the insertion into the storage fails.

###How to Test: Verify the successful addition of the update functionality by using the new update_message method. Test the improved error handling by intentionally causing insertion failures and confirming that the appropriate error, InsertFailed, is returned.

58.5 REP
Submitted

ICP Quiz System This is an ICP Quiz system where users can create quizzes with multiple options, update, delete, get quizzes, retrieve all quizzes, and answer quizzes based on the options given.

0Points
4 Feedbacks
Feedback

Mujhtech

Great work and idea here are the some changes I wanna Share

New Features and Improvements (Pull Request)

1. Added get_quiz_count Function

  • Introduced a new function called get_quiz_count in the ic_cdk::query namespace.
  • The function returns the number of quizzes currently stored in the STORAGE map.
  • This addition does not affect the existing logic or structure.

2. Updated get_all_quiz Function

  • Modified the get_all_quiz function to directly collect values from the STORAGE map using the values() iterator method.
  • Adjusted the error message format for consistency.

3. Updated get_quiz Function

  • Refactored the get_quiz function to use Option::ok_or_else for improved error handling.

4. Updated do_insert Function

  • Utilized the Entry API for HashMap to simplify the insertion logic.

5. Updated create_quiz Function

  • Changed the unwrap method to unwrap_or_else for safer error handling during id incrementation.
  • Removed unnecessary cloning of the quiz in the do_insert call by using quiz.clone_from.

6. Added a New Method to Quiz Struct

  • Introduced a new method called new in the Quiz struct for simplified creation of quizzes with default values for answers.

Feel free to test the new features and improvements and provide feedback. Contributions and suggestions are always welcome!