Skip to main content

ootle_rs/types/
signed.rs

1//   Copyright 2026 The Tari Project
2//   SPDX-License-Identifier: BSD-3-Clause
3
4use crate::types::Signature;
5
6#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
7pub struct Signed<T> {
8    tx: T,
9    signature: Signature,
10}
11
12impl<T> Signed<T> {
13    pub fn new(inner: T, signature: Signature) -> Self {
14        Self { tx: inner, signature }
15    }
16
17    pub fn tx(&self) -> &T {
18        &self.tx
19    }
20
21    pub fn signature(&self) -> &Signature {
22        &self.signature
23    }
24
25    pub fn into_parts(self) -> (T, Signature) {
26        (self.tx, self.signature)
27    }
28}