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: poc on susbstrate parachain #16

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Prathiksha-Nataraja
Copy link
Contributor

Poc on substrate parachain

#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {
StudentCreated { who: T::AccountId, student_id: u32, student_name: String },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove account id from ebent


#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(0)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add marks and average method for student details

let _student = Students::<T>::get(&student_id).ok_or(Error::<T>::StudentNotFound)?;
let average_marks = (internal_marks_1 + internal_marks_2 + internal_marks_3) / 3;

let result = if average_marks >= 40 { "Pass" } else { "Fail" };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Student marks no need to store?

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.

2 participants