Closed
Conversation
* add generate_abi_meta() both for `CompiledProgram` and `TemplateProgram` * add additional field in cli for printing such output
Author
|
Closing it, because macroses implementation would move to https://github.com/BlockstreamResearch/simplex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm now able to introduce a draft version of macros that would simplify building Witness and Arguments for a program.
https://github.com/BlockstreamResearch/simplicity-contracts/blob/main/crates/contracts/src/finance/options/mod.rs
The most common task when building witness and arguments are:
https://github.com/BlockstreamResearch/simplicity-contracts/blob/aaaf2fbc521cc20711e33d4726cbd4aa68c34962/crates/contracts/src/finance/options/build_arguments.rs#L215
Needless to note, that this feature can be made with the help of
AbiMetastruct, which is defined here.Proc macro expands in compile time, so we're able to use its functionality.
We have a macro called
include_simf, where you only need to insert the path to the SimplicityHL contract.Currently, it expands and can create the following:
We also plan to deliver derive macros that can match branch sides and expand code.
Expansion example