Skip to content

Commit

Permalink
feat: add course helpers (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
bezrazli4n0 authored May 23, 2023
1 parent f571cfc commit 49fb55e
Show file tree
Hide file tree
Showing 10 changed files with 283 additions and 50 deletions.
9 changes: 8 additions & 1 deletion contracts/student-nft/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.2.0] - 2023-05-22
### Changed
- Update dependencies.
### Added
- Ability to add more course verifiers(hw, etc).

## [0.1.0] - 2023-05-17
### Added
- Initial release.

[Unreleased]: https://github.com/gear-dapps/student-nft/compare/0.1.0...HEAD
[Unreleased]: https://github.com/gear-dapps/student-nft/compare/0.2.0...HEAD
[0.2.0]: https://github.com/gear-dapps/student-nft/compare/0.1.0...0.2.0
[0.1.0]: https://github.com/gear-dapps/student-nft/compare/8b01ff3...0.1.0
80 changes: 40 additions & 40 deletions contracts/student-nft/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/student-nft/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "student-nft"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
license = "MIT"
authors = ["Gear Technologies"]
Expand Down
2 changes: 1 addition & 1 deletion contracts/student-nft/io/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "student-nft-io"
version = "0.1.0"
version = "0.2.0"
edition = "2021"

[dependencies]
Expand Down
18 changes: 18 additions & 0 deletions contracts/student-nft/io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ pub enum StudentNftAction {
name: String,
description: String,
},
AddCourseHelper {
course_id: CourseId,
helper: ActorId,
},
RemoveCourseHelper {
course_id: CourseId,
helper: ActorId,
},
StartCourse {
course_id: CourseId,
},
Expand Down Expand Up @@ -68,6 +76,14 @@ pub enum StudentNftEvent {
owner: ActorId,
id: CourseId,
},
CourseHelperAdded {
id: CourseId,
helper: ActorId,
},
CourseHelperRemoved {
id: CourseId,
helper: ActorId,
},
CourseStarted {
user: ActorId,
id: CourseId,
Expand Down Expand Up @@ -182,6 +198,7 @@ impl Hw {
#[derive(Debug, Clone, Encode, Decode, TypeInfo)]
pub struct Course {
pub owner: ActorId,
pub owner_helpers: Vec<ActorId>,
pub name: String,
pub description: String,
pub lessons: Vec<Lesson>,
Expand All @@ -194,6 +211,7 @@ impl Course {
pub fn new(owner: &ActorId, name: String, description: String, emote_id: EmoteId) -> Self {
Course {
owner: *owner,
owner_helpers: Vec::new(),
name,
description,
lessons: Vec::new(),
Expand Down
Loading

0 comments on commit 49fb55e

Please sign in to comment.