Skip to content
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

Transform client code to state passing style #709

Closed
j-mueller opened this issue Mar 14, 2019 · 3 comments
Closed

Transform client code to state passing style #709

j-mueller opened this issue Mar 14, 2019 · 3 comments
Assignees
Labels
Contract provisioning How does the contract get from the author's machine to the user's machine

Comments

@j-mueller
Copy link
Contributor

The client code of each contract is going to be compiled to an executable, the contract runtime. The contract runtime should be a stateless component. Therefore we need to transform all actions in the WalletAPI monad into functions that take the current state and produce a new state plus some events (register triggers, create transactions, etc.)

@j-mueller j-mueller self-assigned this Mar 14, 2019
@j-mueller j-mueller added the Contract provisioning How does the contract get from the author's machine to the user's machine label Mar 14, 2019
@michaelpj
Copy link
Contributor

Note: to do this in strictly monadic style we'd need to serialize a continuation back to the client, which we almost certainly don't want to do.

Instead, we probably want applicative style computations, so all the client-side effects we want can be done up front. We could use selective functors to improve this further.

@j-mueller
Copy link
Contributor Author

I had a look at the selective functors paper and it seems to be a great fit for what we're trying to do.

@j-mueller
Copy link
Contributor Author

Implemented in #1013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contract provisioning How does the contract get from the author's machine to the user's machine
Projects
None yet
Development

No branches or pull requests

2 participants