-
Notifications
You must be signed in to change notification settings - Fork 2
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
adds prototype of capabilities decorator #23
base: master
Are you sure you want to change the base?
Conversation
How do we like this as an example? It feels pretty good to me but seems kind of awkward that a single typo can create a whole new capability. Another idea might be to use namespaces to represent capabilities e.g.
This would reduce the number of decorators needed and eliminate the @zome_function one entirely as all functions in a capability namespace would be zome functions |
@@ -0,0 +1,48 @@ | |||
"use strict"; | |||
|
|||
var _testHelper = require("./test-helper"); |
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.
How come this file is added?
@@ -85,7 +85,7 @@ mod tests { | |||
#[test] | |||
fn test_init_globals() { | |||
let mut hc = setup_hc(); | |||
let globals_result = hc.call("three", "main", "test_init_globals", ""); | |||
let globals_result = hc.call("three", "other_capability", "test_init_globals", ""); |
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.
This file shouldn't exist anymore...
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.
I like your other suggestion too, but I feel good about just going with this for now, and trying it
@@ -13,7 +13,7 @@ import { | |||
|
|||
/*---------- Public Functions ----------*/ | |||
|
|||
@zome_function | |||
@capability('main') |
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.
Dept. of Names Dept. Q: does it make more sense to describe each of these functions as a "capability" or a "zome function"? I like that calling the decorator capability
makes it clear what the argument should be, but using @zomeFunction(capabilityName)
makes more sense to me with regard to what it actually is decorating.
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.
Willem and I were just chatting, and his latest thought was this...
@capability('agent')
namespace main {
...
}
where multiple zome functions are defined within the namespace. agent
refers to the access membrane
Closes #22