Skip to content

Instantiate all note scripts from libraries instead of programs #2617

@PhilippGackstatter

Description

@PhilippGackstatter

After #2502 we should make sure we only construct NoteScripts from libraries, for uniformity. Additionally, there are some small improvements we can make:

  • Remove NoteScript::new and convert usages to NoteScript::from_library(_reference).
  • Add a test for NoteScript::from_library which is currently unused. Check if there is an opportunity to deduplicate code with NoteScript::from_library_reference.
  • Prefer calling NoteScript::from_parts within the from_library* methods so we have a single place where a note script is actually created.
  • Remove NoteScript::from_bytes which is unused and delegates to deserialization internally. This is not our usual pattern for deserializing from bytes.

Context: #2502 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    rustIssues that affect or pull requests that update Rust code

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions