Skip to content

Commit

Permalink
getters for action list struct
Browse files Browse the repository at this point in the history
  • Loading branch information
TalDerei authored and conorsch committed Sep 16, 2024
1 parent 402675e commit 649b990
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions crates/core/transaction/src/action_list.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use anyhow::Result;
use penumbra_proto::core::transaction::v1::Action;
use std::collections::BTreeMap;

use crate::plan::MemoPlan;
Expand Down Expand Up @@ -29,6 +30,21 @@ pub struct ActionList {
}

impl ActionList {
/// Returns an immutable reference to a list of action plans.
pub fn actions(&self) -> &Vec<ActionPlan> {
&self.actions
}

/// Returns an immutable reference to a map of change outputs.
pub fn change_outputs(&self) -> &BTreeMap<asset::Id, OutputPlan> {
&self.change_outputs
}

/// Returns an immutable reference to the fee.
pub fn fee(&self) -> &Fee {
&self.fee
}

/// Returns true if the resulting transaction would require a memo.
pub fn requires_memo(&self) -> bool {
let has_change_outputs = !self.change_outputs.is_empty();
Expand Down

0 comments on commit 649b990

Please sign in to comment.