-
Notifications
You must be signed in to change notification settings - Fork 14
use/include contract with a single step #13
Comments
related #8 |
Last two steps can be indeed simplified, although I can't see how we can get rid of the build script - the solidity ABI needs to be generated before the compilation of Rust code is performed (since the staticly-typed contract interface is generated out of it), so we need to have a way to compile contracts before compiling rust tests. |
could we have a procedural macro that shells out to the solidity compiler? |
Good point. Yeah I suppose it would be possible. |
I really like the way pest_derive does this (procedural macros, all magic happens during compile time): |
working on https://github.com/snd/rust_solc which will use the JSON I/O API of solc/solcjs and will get us one step closer to this |
currently to test a contract with sol-rs one needs to:
compile it in a build script: https://github.com/paritytech/sol-rs/blob/aed4bb377db6bf7459e5ee3792e1d7cddfb45cef/example/build.rs#L4
use_contract!
on the ABI file: https://github.com/paritytech/sol-rs/blob/aed4bb377db6bf7459e5ee3792e1d7cddfb45cef/example/src/main.rs#L15load code from the bin file: https://github.com/paritytech/sol-rs/blob/aed4bb377db6bf7459e5ee3792e1d7cddfb45cef/example/src/main.rs#L20
ideally it would require a single step. wishful thinking:
the API should allow support the convenient single step as well as the individual steps.
The text was updated successfully, but these errors were encountered: