-
Notifications
You must be signed in to change notification settings - Fork 71
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
Add a very simple account contract example. #227
Conversation
This is close to minimal possible valid account contract that is aimed at demonstrating the most basic concepts.
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!
Love how simple this is. 👏🏻 |
env.invoke_account_contract_check_auth::<Status>( | ||
&account_contract.contract_id, | ||
&payload, | ||
&vec![&env, sign(&env, &signer, &payload)], | ||
&vec![&env], | ||
) |
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.
Why do we need to use invoke_account_contract_check_auth
? Can we test the account contract by simply calling the contract like it would be called in deployment?
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 actually emulates the call from host - __check_auth
function is reserved and can't be called directly (we've also recently reserved all the contract functions starting with __
as well). The comment above tries to explain that.
* main: Add a very simple account contract example. (stellar#227)
* main: Add a very simple account contract example. (stellar#227)
What
Add a very simple account contract example.
This is close to minimal possible valid account contract that is aimed at demonstrating the most basic concepts.
Why
This is in response to request for a simpler account contract example(#226) - the only existing example is quite involved and aims at demonstrating all the account contract features.
Known limitations
N/A