-
Notifications
You must be signed in to change notification settings - Fork 6
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
base: master
Are you sure you want to change the base?
feat: poc on susbstrate parachain #16
Conversation
#[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 }, |
There was a problem hiding this comment.
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)] |
There was a problem hiding this comment.
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" }; |
There was a problem hiding this comment.
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?
Poc on substrate parachain