feat: Introduce macros for generating dispatching func, inputs and outputs#1
Closed
DennisInSky wants to merge 6 commits into
Closed
feat: Introduce macros for generating dispatching func, inputs and outputs#1DennisInSky wants to merge 6 commits into
DennisInSky wants to merge 6 commits into
Conversation
NikVolf
reviewed
Nov 10, 2023
| gsys::gr_panic(result.as_ptr(), result.len() as u32); | ||
| } | ||
| } | ||
| msg::reply(result, 0).expect("This needs to be handled in a consistent way: reply error"); |
Contributor
Author
There was a problem hiding this comment.
This is not gas, but value. As far as I get transferring value from a contract is not used
Member
|
Async example right away would be nice |
NikVolf
reviewed
Nov 10, 2023
| // That | ||
| fn do_that( | ||
| param: DoThatParam, | ||
| ) -> Result<(String, u32), (String,) /* IDEA can't handle meta with single element tuple */> |
Member
There was a problem hiding this comment.
why do you need here single element tuple anyway?
Contributor
Author
There was a problem hiding this comment.
This is just as many possible type usages as I could imagine.
Contributor
Author
Do we want to generate async version of |
shamilsan
approved these changes
Nov 20, 2023
shamilsan
left a comment
There was a problem hiding this comment.
It looks good to me as a starting point.
Contributor
Author
Contributor
Author
|
It will be merged in via a child branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces
command_handlersandquery_handlersattributes for modules implementing some handlers. Any standalone function of the module regardless of the function visibility is considered to be a handler. Based on the functions signature, the macro generates 2 enums: one for input params, another for output ones, and a function which takes an input enum variant as a param, dispatches it to one of the defined handlers, and returns an output enum variant as a result with indication whether the call was successful or not.