use resources::asset::Flags;
#[derive(Debug, Clone)]
pub struct SetOptions {
signer_key: String,
signer_weight: u8,
master_key_weight: u8,
thresholds: Thresholds,
home_domain: String,
set_flags: Option<Flags>,
clear_flags: Option<Flags>,
}
#[derive(Debug, Clone, Copy)]
pub struct Thresholds {
low: u32,
med: u32,
high: u32,
}
impl SetOptions {
pub fn new(
signer_key: String,
signer_weight: u8,
master_key_weight: u8,
(low, med, high): (u32, u32, u32),
home_domain: String,
set_flags: Option<Flags>,
clear_flags: Option<Flags>,
) -> SetOptions {
SetOptions {
signer_key,
signer_weight,
master_key_weight,
thresholds: Thresholds { low, med, high },
home_domain,
set_flags,
clear_flags,
}
}
pub fn signer_key(&self) -> &str {
&self.signer_key
}
pub fn signer_weight(&self) -> u8 {
self.signer_weight
}
pub fn master_key_weight(&self) -> u8 {
self.master_key_weight
}
pub fn low_threshold(&self) -> u32 {
self.thresholds.low
}
pub fn med_threshold(&self) -> u32 {
self.thresholds.med
}
pub fn high_threshold(&self) -> u32 {
self.thresholds.high
}
pub fn home_domain(&self) -> &str {
&self.home_domain
}
pub fn set_flags(&self) -> Option<Flags> {
self.set_flags
}
pub fn clear_flags(&self) -> Option<Flags> {
self.clear_flags
}
}