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
Conversation
I just noted that the csv already has a category field. I'll add other types and change the ones I used tomorrow :catsalute: |
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.
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 ;)
candid/registry.did
Outdated
type canister_metadata = record { | ||
name: text; | ||
description: text; | ||
url: text; | ||
logo_url: text; | ||
version: nat32; | ||
category: canister_category |
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.
missing semicolon
candid/registry.did
Outdated
}; | ||
|
||
type input_canister_metadata = record { | ||
name: text; | ||
description: text; | ||
url: text; | ||
logo_url: text; | ||
category: canister_category |
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.
missing semicolon
@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() { |
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.
Unnecessary enumerate
if you don't need the _key
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