Skip to content

Enable CodeBuilder to add advice map entries to compiled scripts #2267

@PhilippGackstatter

Description

@PhilippGackstatter

The CodeBuilder should allow building note and tx scripts with advice map entries in the MastForest that is created.

One use case for this is AccountInterface::build_send_notes_script which handles note attachment creation. When it creates a NoteAttachmentContent::Array it would be ideal if it could add the required elements to the advice map of the created transaction script's MastForest.

This should be possible by calling Assembler::assemble_program with a type that implements Parse::parse and returns a custom Module with the advice map entries.

If I'm not mistaken, there is currently no pub method for adding advice map entries to Modules, so this probably doesn't work yet. The question is, should this be possible or is there another way that should be used? cc @plafer

If this is doable, this should then adapt the test_send_note_script_basic_wallet test to remove the explicit advice map entry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersrustIssues that affect or pull requests that update Rust code

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions