-
Notifications
You must be signed in to change notification settings - Fork 11
fix: doc comment on Role variant crashes macro #33
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,11 +4,15 @@ use near_sdk::serde::{Deserialize, Serialize}; | |
| use near_sdk::{env, log, near_bindgen, AccountId}; | ||
| use std::collections::HashMap; | ||
|
|
||
| /// Roles are represented by enum variants. | ||
| #[derive(AccessControlRole, Deserialize, Serialize, Copy, Clone)] | ||
| #[serde(crate = "near_sdk::serde")] | ||
| pub enum Role { | ||
| /// Represents LevelA. | ||
| LevelA, | ||
| /// Represents LevelB. | ||
| LevelB, | ||
| /// Represents LevelC. | ||
|
Comment on lines
+7
to
+15
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding not-so-meaningful comments to show it's now working and to avoid regressions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a note, we can add these comments in an enum in some of the examples to test the regression. |
||
| LevelC, | ||
| } | ||
|
|
||
|
|
||
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.
It was a bug to not do
map(|v| v.ident). The test contract used only plain variants likeLevelAwithout comments, data or custom discriminants, which prevented the bug from surfacing.