pub struct TransactionArgs { /* private fields */ }Expand description
Optional transaction arguments.
- Transaction script: a program that is executed in a transaction after all input notes scripts have been executed.
- Note arguments: data put onto the stack right before a note script is executed. These are different from note inputs, as the user executing the transaction can specify arbitrary note args.
- Advice inputs: Provides data needed by the runtime, like the details of public output notes.
- Account inputs: Provides account data that will be accessed in the transaction.
Implementations§
Source§impl TransactionArgs
impl TransactionArgs
Sourcepub fn new(
tx_script: Option<TransactionScript>,
note_args: Option<BTreeMap<NoteId, Word>>,
advice_map: AdviceMap,
foreign_account_inputs: Vec<AccountInputs>,
) -> Self
pub fn new( tx_script: Option<TransactionScript>, note_args: Option<BTreeMap<NoteId, Word>>, advice_map: AdviceMap, foreign_account_inputs: Vec<AccountInputs>, ) -> Self
Returns new TransactionArgs instantiated with the provided transaction script and note arguments.
If tx_script is provided, this also adds all mappings from the transaction script inputs to the advice inputs’ map.
Sourcepub fn with_tx_script(self, tx_script: TransactionScript) -> Self
pub fn with_tx_script(self, tx_script: TransactionScript) -> Self
Returns new TransactionArgs instantiated with the provided transaction script.
Sourcepub fn with_note_args(self, note_args: BTreeMap<NoteId, Word>) -> Self
pub fn with_note_args(self, note_args: BTreeMap<NoteId, Word>) -> Self
Returns new TransactionArgs instantiated with the provided note arguments.
Sourcepub fn tx_script(&self) -> Option<&TransactionScript>
pub fn tx_script(&self) -> Option<&TransactionScript>
Returns a reference to the transaction script.
Sourcepub fn get_note_args(&self, note_id: NoteId) -> Option<&Word>
pub fn get_note_args(&self, note_id: NoteId) -> Option<&Word>
Returns a reference to a specific note argument.
Sourcepub fn advice_inputs(&self) -> &AdviceInputs
pub fn advice_inputs(&self) -> &AdviceInputs
Returns a reference to the args AdviceInputs.
Sourcepub fn foreign_account_inputs(&self) -> &[AccountInputs]
pub fn foreign_account_inputs(&self) -> &[AccountInputs]
Returns a reference to the foreign account inputs in the transaction args.
Sourcepub fn foreign_account_code_commitments(&self) -> BTreeSet<Digest>
pub fn foreign_account_code_commitments(&self) -> BTreeSet<Digest>
Collects and returns a set containing all code commitments from foreign accounts.
Sourcepub fn add_output_note_recipient<T: AsRef<NoteRecipient>>(
&mut self,
note_recipient: T,
)
pub fn add_output_note_recipient<T: AsRef<NoteRecipient>>( &mut self, note_recipient: T, )
Populates the advice inputs with the expected recipient data for creating output notes.
The advice inputs’ map is extended with the following keys:
- recipient_digest |-> recipient details (inputs_hash, script_root, serial_num).
- inputs_commitment |-> inputs.
- script_root |-> script.
Sourcepub fn extend_output_note_recipients<T, L>(&mut self, notes: L)
pub fn extend_output_note_recipients<T, L>(&mut self, notes: L)
Populates the advice inputs with the specified note recipient details.
The advice inputs’ map is extended with the following keys:
- recipient |-> recipient details (inputs_hash, script_root, serial_num).
- inputs_commitment |-> inputs.
- script_root |-> script.
Sourcepub fn extend_advice_inputs(&mut self, advice_inputs: AdviceInputs)
pub fn extend_advice_inputs(&mut self, advice_inputs: AdviceInputs)
Extends the advice inputs in self with the provided ones.
Sourcepub fn extend_advice_map<T: IntoIterator<Item = (Digest, Vec<Felt>)>>(
&mut self,
iter: T,
)
pub fn extend_advice_map<T: IntoIterator<Item = (Digest, Vec<Felt>)>>( &mut self, iter: T, )
Extends the internal advice inputs’ map with the provided key-value pairs.
Sourcepub fn extend_merkle_store<I: Iterator<Item = InnerNodeInfo>>(
&mut self,
iter: I,
)
pub fn extend_merkle_store<I: Iterator<Item = InnerNodeInfo>>( &mut self, iter: I, )
Extends the internal advice inputs’ merkle store with the provided nodes.
Trait Implementations§
Source§impl Clone for TransactionArgs
impl Clone for TransactionArgs
Source§fn clone(&self) -> TransactionArgs
fn clone(&self) -> TransactionArgs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransactionArgs
impl Debug for TransactionArgs
Source§impl Default for TransactionArgs
impl Default for TransactionArgs
Source§fn default() -> TransactionArgs
fn default() -> TransactionArgs
Source§impl Deserializable for TransactionArgs
impl Deserializable for TransactionArgs
Source§fn read_from<R: ByteReader>(
source: &mut R,
) -> Result<Self, DeserializationError>
fn read_from<R: ByteReader>( source: &mut R, ) -> Result<Self, DeserializationError>
source, attempts to deserialize these bytes
into Self, and returns the result. Read moreSource§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
Source§impl PartialEq for TransactionArgs
impl PartialEq for TransactionArgs
Source§impl Serializable for TransactionArgs
impl Serializable for TransactionArgs
Source§fn write_into<W: ByteWriter>(&self, target: &mut W)
fn write_into<W: ByteWriter>(&self, target: &mut W)
self into bytes and writes these bytes into the target.Source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
impl Eq for TransactionArgs
impl StructuralPartialEq for TransactionArgs
Auto Trait Implementations§
impl Freeze for TransactionArgs
impl RefUnwindSafe for TransactionArgs
impl Send for TransactionArgs
impl Sync for TransactionArgs
impl Unpin for TransactionArgs
impl UnwindSafe for TransactionArgs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more