feat: migrate transaction scripts to Library#3173
Open
TomasArrachea wants to merge 2 commits into
Open
Conversation
`@transaction_script` attribute
a63c913 to
af44cea
Compare
bobbinth
approved these changes
Jul 1, 2026
Comment on lines
+343
to
347
| // TODO: we can remove this `Program` based constructor once the compiler integrates the | ||
| // `@transaction_script` attribute (https://github.com/0xMiden/compiler/issues/1190). | ||
| pub fn new(code: Program) -> Self { | ||
| Self::from_parts(code.mast_forest().clone(), code.entrypoint()) | ||
| } |
Contributor
There was a problem hiding this comment.
Let's do this in a follow up right after this PR. And we should do the same for note scripts.
cc @greenhat for visibility.
Comment on lines
+25
to
+26
| @transaction_script | ||
| pub proc main |
Contributor
There was a problem hiding this comment.
Not for this PR, but we should move this out into a package (similar to how we do with notes).
Comment on lines
+105
to
+106
| let script = | ||
| format!("@transaction_script\npub proc main\n{expiration_prelude}\n{body}\nend"); |
Contributor
There was a problem hiding this comment.
nit: instead of using @transaction_script here as a string literal, should we use the constant defined in the protocol library?
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.
Closes #3093
This PR migrates transaction scripts to the library form and adds a
@transaction_scriptattribute to mark the entrypoint procedure.