summaryrefslogtreecommitdiffstatshomepage
path: root/src/message.rs
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2024-04-23 14:03:22 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2024-04-23 16:08:56 +0100
commit6e0ea248ff2b978754331e59f684a5b7a8d4341d (patch)
treedf8f2905379922136ba6dfd6f410b34fff48fdc3 /src/message.rs
parent849820e626b06f8e99f2e88b1391d101bca3640c (diff)
downloadsentrum-6e0ea248ff2b978754331e59f684a5b7a8d4341d.tar.gz
sentrum-6e0ea248ff2b978754331e59f684a5b7a8d4341d.tar.bz2
sentrum-6e0ea248ff2b978754331e59f684a5b7a8d4341d.zip
Deprivatize MessageParams getters
Diffstat (limited to 'src/message.rs')
-rw-r--r--src/message.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/message.rs b/src/message.rs
index 14973bf..1f22779 100644
--- a/src/message.rs
+++ b/src/message.rs
@@ -28,15 +28,15 @@ impl<'a, 'b> MessageParams<'a, 'b> {
}
}
- fn tx_net(&self) -> i64 {
+ pub fn tx_net(&self) -> i64 {
(self.tx.received as i64) - (self.tx.sent as i64)
}
- fn tx_height(&self) -> Option<u32> {
+ pub fn tx_height(&self) -> Option<u32> {
self.tx.confirmation_time.as_ref().map(|x| x.height)
}
- fn confs(&self) -> u32 {
+ pub fn confs(&self) -> u32 {
let current_height = self.current_height;
self.tx_height()
.map(|h| {
@@ -49,7 +49,7 @@ impl<'a, 'b> MessageParams<'a, 'b> {
.unwrap_or_default()
}
- fn conf_timestamp(&self) -> String {
+ pub fn conf_timestamp(&self) -> String {
self.tx
.confirmation_time
.as_ref()
@@ -62,10 +62,10 @@ impl<'a, 'b> MessageParams<'a, 'b> {
.unwrap_or_default()
}
- fn txid(&self) -> String {
+ pub fn txid(&self) -> String {
self.tx.txid.to_string()
}
- fn txid_short(&self) -> String {
+ pub fn txid_short(&self) -> String {
let txid = self.txid();
format!("{}...{}", &txid[..6], &txid[txid.len() - 6..])
}