-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat!: read/write context/permission #270
feat!: read/write context/permission #270
Conversation
Because created a function to export the read-write permission of each function of callable_point outside
Added to check if read-write and read-only permissions are properly inherited As for sub, intentionally use handle-sub as a function with read-wirte permission
2921519
to
65e2818
Compare
because to make it easy to understand that thsi contract is between call-number and number
divide into module modified for better understanding
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.
Write what the callable_points
macro does in the docs.
"Function attributed with this macro must take deps
..." is not suitable for this macro.
5d38732#diff-484ed4ec90b9bea6e333d2819a67f7b7421528d49e411d19fb93f25105e070abR96
In this code, serialization of the map (name -> permission) is done in generated code. But, we can serialize it in macro (compile time) and use serialized binary in generated code. |
rename __callable_point to callable_points fix typo add document
Co-authored-by: TAKASE Ryo <loloicci@loloicci.dev>
change to use serialized binaries
There is a typo in the command in Description. Please add |
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.
LGTM
The read-write permission was confusing, so the structure has been modified.
|
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.
Sorry for canceling approval, but recheck these comments.
#270 (comment)
#270 (comment)
I missed c337ae7, sorry.
Never mind.
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.
LGTM
Description
This PR is related to #263.
#[callable_points]
macro (NOT#[callable_point]
) was created to expose read-write permissions to WASM using the_get_callable_points_properties()
.This macro is used as follows.
#[callable_point]
is used as a mark rather than an attribute macro.Only those with
#[callable_point]
above the function will be exposed to WASM.It is also used for functions that manage read-write permissions for each function.
In the above example, the
_get_callable_points_properties()
can be used to retrieve the following map.(
true
is read-only,false
is read-write)I also added a contract called
intermediate-number
, which has the roles of callee and caller.Only
sub
is intentionally made a function with read-write permission.The code expanded in macro can be viewed below.
First, it may be necessary to add cargo expand and the target of wasm32-unknown-unknown.
Closes #263
Types of changes
Checklist