Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat - implement update student from array and mapping in student registry contracts #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

salimkarbm
Copy link

@salimkarbm salimkarbm commented Jul 28, 2024

StudentRegistry Contract

Description

This PR introduces new features to the StudentRegistry contract:

Updating Student in Mapping:

  • Implemented updating a student's name and age from the student mapping.
  • Ensures the student exists before updating.

Updating Student in Array:

  • Ensures the student exists before updating.
  • Implemented updating a student's name, age, and address in the student array.

deleting Student in Mapping:

  • Implemented updating a student with their address from the student mapping.
  • Ensures the student exists before deleting.

deleting Student in Array:

  • Ensures the student exists before deleting.
  • Implemented deleting a student with their ID from the student array.

Events:

  • Implemented UpdatedStudentEvent and DeleteStudentEvent.
    • UpdatedStudentEvent returns the student's address, ID, name, and age.
    • DeleteStudentEvent returns the student record.

Context

This PR ensures clarity on the features and usage of the StudentRegistry contract while providing detailed insights into the changes introduced in this PR.

Tests

  • Manual Testing:
    • Compiled the contract locally and manually tested the updateStudent and deleteStudent functions.
    • Deployed the contract locally and tested the functions and event emissions.

PR Checklist

  • Tests
  • Documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant