Skip to content

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

Open
salimkarbm wants to merge 1 commit intoBlockheaderWeb3-Community:mainfrom
salimkarbm:salim
Open

feat - implement update student from array and mapping in student registry contracts#7
salimkarbm wants to merge 1 commit intoBlockheaderWeb3-Community:mainfrom
salimkarbm:salim

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