General cleanup for the docs

This commit is contained in:
Alekos Filini
2020-08-31 10:49:44 +02:00
parent d61e974dbe
commit c0867a6adc
23 changed files with 305 additions and 201 deletions

View File

@@ -58,6 +58,34 @@ impl AsRef<[u8]> for ScriptType {
}
}
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)]
// Internally stored as satoshi/vbyte
pub struct FeeRate(f32);
impl FeeRate {
pub fn from_btc_per_kvb(btc_per_kvb: f32) -> Self {
FeeRate(btc_per_kvb * 1e5)
}
pub fn from_sat_per_vb(sat_per_vb: f32) -> Self {
FeeRate(sat_per_vb)
}
pub fn default_min_relay_fee() -> Self {
FeeRate(1.0)
}
pub fn as_sat_vb(&self) -> f32 {
self.0
}
}
impl std::default::Default for FeeRate {
fn default() -> Self {
FeeRate::default_min_relay_fee()
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
pub struct UTXO {
pub outpoint: OutPoint,