bee_block/output/unlock_condition/
governor_address.rs1use derive_more::From;
5
6use crate::address::Address;
7
8#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, From, packable::Packable)]
11#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12pub struct GovernorAddressUnlockCondition(Address);
13
14impl GovernorAddressUnlockCondition {
15 pub const KIND: u8 = 5;
17
18 #[inline(always)]
20 pub fn new(address: Address) -> Self {
21 Self(address)
22 }
23
24 #[inline(always)]
26 pub fn address(&self) -> &Address {
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::address::dto::AddressDto;
37
38 #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
39 pub struct GovernorAddressUnlockConditionDto {
40 #[serde(rename = "type")]
41 pub kind: u8,
42 pub address: AddressDto,
43 }
44}