-
Notifications
You must be signed in to change notification settings - Fork 32
SC: Implement call wrapper to simplify making sync calls #351
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
base: sync_call_entry_func
Are you sure you want to change the base?
Conversation
…ols for read_only and behavior when sync call is not supported by receiver
…ead-only enforcement
- Remove unnecessary call class - Make C++ call host function simply invoke C version - Make call_wrapper constructor take only one argument (receiver); all others are template parameters - Make call_wrapper handle high level logic
…to support_mode for simplicity
In the PR description.
In the host functions example, I think it would be better to use |
Thanks for your detailed comments! Updated the PR description. |
…l; it is much cleanner
…y when one is not provided
Change Description
API Changes
This PR implements
call_wrapper
for contract authors to simplify making sync calls. Instead of using sync call host functions directly, it is recommend contract authors usecall_wrapper
.Below is a full working example of caller contract making a sync call in the callee contract.
Calle header file "callee.hpp"
Callee implementation file, "callee.cpp":
Caller file:
In comparison, a caller using host functions directly to make the same call would look like
Documentation Additions