Skip to main content

bee_ledger_types/
treasury_output.rs

1// Copyright 2020-2021 IOTA Stiftung
2// SPDX-License-Identifier: Apache-2.0
3
4use bee_block::{output, payload::milestone::MilestoneId};
5
6/// Records the creation of a treasury output.
7#[derive(Clone, Debug, Eq, PartialEq, packable::Packable)]
8pub struct TreasuryOutput {
9    inner: output::TreasuryOutput,
10    milestone_id: MilestoneId,
11}
12
13impl TreasuryOutput {
14    /// Creates a new `TreasuryOutput`.
15    pub fn new(inner: output::TreasuryOutput, milestone_id: MilestoneId) -> Self {
16        Self { inner, milestone_id }
17    }
18
19    /// Returns the inner output of a `TreasuryOutput`.
20    pub fn inner(&self) -> &output::TreasuryOutput {
21        &self.inner
22    }
23
24    /// Returns the id of the milestone that created the `TreasuryOutput`.
25    pub fn milestone_id(&self) -> &MilestoneId {
26        &self.milestone_id
27    }
28}