1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use schemars::JsonSchema;
use serde::Serialize;
use super::PoolSlug;
/// Mining pool information
#[derive(Debug, Serialize, JsonSchema)]
pub struct Pool {
/// Unique pool identifier
pub slug: PoolSlug,
/// Pool name
pub name: &'static str,
/// Known payout addresses for pool identification
#[serde(skip)]
pub addrs: Box<[&'static str]>,
/// Coinbase tags used to identify blocks mined by this pool
#[serde(skip)]
pub tags: Box<[&'static str]>,
/// Lowercase coinbase tags for case-insensitive matching
#[serde(skip)]
#[schemars(skip)]
pub tags_lowercase: Box<[String]>,
/// Pool website URL
pub link: &'static str,
}
impl Pool {
/// Get slug of pool
pub fn slug(&self) -> PoolSlug {
self.slug
}
/// Get the pool's unique numeric ID
pub fn unique_id(&self) -> u8 {
self.slug.into()
}
}