Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
igamigo committed Sep 17, 2024
1 parent 61edbee commit edebb93
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 1 addition & 3 deletions miden-lib/src/notes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ use miden_objects::{
crypto::rand::FeltRng,
notes::{
Note, NoteAssets, NoteDetails, NoteExecutionHint, NoteExecutionMode, NoteInputs,
NoteMetadata, NoteRecipient, NoteScript, NoteTag, NoteType,
NoteMetadata, NoteRecipient, NoteTag, NoteType,
},
utils::Deserializable,
vm::Program,
Felt, NoteError, Word,
};
use utils::build_swap_tag;
Expand Down
3 changes: 3 additions & 0 deletions miden-lib/src/notes/scripts.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
use miden_objects::{notes::NoteScript, utils::Deserializable, vm::Program};

/// Returns a P2ID (Pay-to-ID) note script.
pub fn p2id() -> NoteScript {
let bytes = include_bytes!(concat!(env!("OUT_DIR"), "/assets/note_scripts/P2ID.masb"));
let program = Program::read_from_bytes(bytes).expect("Shipped P2ID script is well-formed");

NoteScript::new(program)
}

/// Returns a P2IDR (Pay-to-ID with recall) note script.
pub fn p2idr() -> NoteScript {
let bytes = include_bytes!(concat!(env!("OUT_DIR"), "/assets/note_scripts/P2IDR.masb"));
let program = Program::read_from_bytes(bytes).expect("Shipped P2IDR script is well-formed");

NoteScript::new(program)
}

/// Returns a SWAP (Pay-to-ID with recall) note script.
pub fn swap() -> NoteScript {
let bytes = include_bytes!(concat!(env!("OUT_DIR"), "/assets/note_scripts/SWAP.masb"));
let program = Program::read_from_bytes(bytes).expect("Shipped SWAP script is well-formed");
Expand Down
3 changes: 2 additions & 1 deletion miden-lib/src/notes/utils.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use miden_objects::{
accounts::AccountId,
notes::{NoteInputs, NoteRecipient, NoteScript},
assets::Asset,
notes::{NoteExecutionMode, NoteInputs, NoteRecipient, NoteScript, NoteTag, NoteType},
utils::Deserializable,
vm::Program,
NoteError, Word,
Expand Down

0 comments on commit edebb93

Please sign in to comment.