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

wip: feat(scrt-contract): nice bindings #34

Merged
merged 25 commits into from
Jul 30, 2021
Merged

Conversation

egasimus
Copy link
Collaborator

This is meant to allow for contracts to be more easily tested in a browser. Currently when you load a WASM blob in a browser, you just get the entrypoints that are meant for cosmwasm-vm, which only take 1 or 2 u32 pointers. By identifying the correct API layers to hook into, something similar to the schema-based API wrappers of scrt-contract can be generated as a feature of the contract itself (behind a feature flag), exposing the "nice" API directly.

See also: scrt-harness as another step towards struct Contract.

@egasimus
Copy link
Collaborator Author

egasimus commented Jul 24, 2021

  • It is now possible to test the business logic of a Fadroma-based smart contract in the rich interactive environment of your garden variety Web browser (provided you do your own serialization on the JS side with TextEncoder/TextDecoder). Example here.
  • The source of scrt-contract module was refactored into three layers - the entrypoint bindings, the API types, and the API implementation.
  • Considering deprecation of State section as it feels unnecessarily bolted-on.
  • First appearance of a struct Contract { deps, env } - this and scrt-harness should be enough to come up with some future simplifications to the contract! macro which to hopefully give scrt-contract a slightly better onramp profile :-)

@egasimus egasimus marked this pull request as ready for review July 30, 2021 09:17
@egasimus egasimus merged commit dc682d0 into 21.07 Jul 30, 2021
@egasimus egasimus deleted the feature/nice-bindings branch August 11, 2021 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants