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

Rocky/add category field #29

Merged
merged 6 commits into from Nov 3, 2021
Merged

Rocky/add category field #29

merged 6 commits into from Nov 3, 2021

Conversation

rocky-fleek
Copy link
Contributor

Summary

Added category field in canister metadata.
The category is one of 3 possible values (Asset, Nft, Service) and so I implemented it as an enum but I'm not sure if that's correct or not.

@Nima-Ra I know I'm missing something on the upgrade script, cause I don't know how it would populate the fields otherwise. Just not sure how you do that to be honest

@rocky-fleek
Copy link
Contributor Author

I just noted that the csv already has a category field. I'll add other types and change the ones I used tomorrow :catsalute:

Copy link
Contributor

@Nima-Ra Nima-Ra left a comment

Choose a reason for hiding this comment

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

Looks good to me! I see you have come far in learning rust!
I don't think we should merge until the upgrade.rs is updated.
I will update that later and merge ;)

type canister_metadata = record {
name: text;
description: text;
url: text;
logo_url: text;
version: nat32;
category: canister_category
Copy link
Contributor

Choose a reason for hiding this comment

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

missing semicolon

};

type input_canister_metadata = record {
name: text;
description: text;
url: text;
logo_url: text;
category: canister_category
Copy link
Contributor

Choose a reason for hiding this comment

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

missing semicolon

@alejo-acevedo-deel
Copy link

@Nima-Ra @rocky-fleek could merge this?

if let Ok((stable,)) = ic::stable_restore::<(StableStorageV0,)>() {
let data = get_data();
let mut canister_list = Vec::with_capacity(stable.db.len());
for (_key, canister_info) in stable.db.into_iter().enumerate() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary enumerate if you don't need the _key

@Nima-Ra Nima-Ra merged commit 71e62b1 into main Nov 3, 2021
@Nima-Ra Nima-Ra deleted the rocky/add-category-field branch November 3, 2021 17:02
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.

None yet

4 participants