bee_block/unlock/
signature.rs1use derive_more::{Deref, From};
5
6use crate::signature::Signature;
7
8#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, From, Deref, packable::Packable)]
11#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12pub struct SignatureUnlock(Signature);
13
14impl SignatureUnlock {
15 pub const KIND: u8 = 0;
17
18 #[inline(always)]
20 pub fn new(signature: Signature) -> Self {
21 Self(signature)
22 }
23
24 #[inline(always)]
26 pub fn signature(&self) -> &Signature {
27 &self.0
28 }
29}
30
31#[cfg(feature = "dto")]
32#[allow(missing_docs)]
33pub mod dto {
34 use serde::{Deserialize, Serialize};
35
36 use crate::signature::dto::SignatureDto;
37
38 #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
40 pub struct SignatureUnlockDto {
41 #[serde(rename = "type")]
42 pub kind: u8,
43 pub signature: SignatureDto,
44 }
45}