Implement standard conversions `Network`->`Params`
This commit is contained in:
parent
9a8694fae5
commit
9282cc4dad
|
@ -116,3 +116,27 @@ impl Params {
|
|||
self.pow_target_timespan / self.pow_target_spacing
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Network> for Params {
|
||||
fn from(value: Network) -> Self {
|
||||
Self::new(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&Network> for Params {
|
||||
fn from(value: &Network) -> Self {
|
||||
Self::new(*value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Network> for &'static Params {
|
||||
fn from(value: Network) -> Self {
|
||||
value.params()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&Network> for &'static Params {
|
||||
fn from(value: &Network) -> Self {
|
||||
value.params()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue