+ %% if let Some(terms) = self.entry.terms {
+ %% if let Some(symbol) = self.entry.symbol {
+
maximum supply
+
{{ (terms.cap.unwrap_or_default() * terms.amount.unwrap_or_default()) + self.entry.premine }}{{ symbol }}
+ %% } } else {
+
maximum supply
+
Unable to calculate maximum supply
+ %% }
+ %% if let Some(terms) = self.entry.terms {
+ %% if let Some(symbol) = self.entry.symbol {
+
supply progress
+
{{ self.entry.pile(self.entry.supply()) }} of {{ (terms.cap.unwrap_or_default() * terms.amount.unwrap_or_default()) + self.entry.premine }}{{ symbol }}
+ %% } } else {
+
supply progress
+
Unable to calculate supply progress
+ %% }
premine
{{ self.entry.pile(self.entry.premine) }}
-
premine percentage
+
premine percentage of current supply
{{ Decimal { value: ((self.entry.premine as f64 / self.entry.supply() as f64) * 10000.0) as u128, scale: 2 } }}%
+ %% if let Some(terms) = self.entry.terms {
+
premine percentage of maximum supply
+
{{ Decimal { value: ((self.entry.premine as f64 / ((terms.cap.unwrap_or_default() as f64 * terms.amount.unwrap_or_default() as f64) + self.entry.premine as f64)) * 10000.0) as u128, scale: 2 } }}%
+ %% } else {
+
premine percentage of maximum supply
+
Unable to calculate premine percentage of maximum supply
+ %% }
burned
{{ self.entry.pile(self.entry.burned) }}
divisibility
From d37966ce2758268e5fc9d530bb21e931c513f8d2 Mon Sep 17 00:00:00 2001
From: nine <118634361+cryptoni9n@users.noreply.github.com>
Date: Thu, 16 May 2024 17:36:29 -0400
Subject: [PATCH 02/21] Update index.rs to fix ord list command
this is Greg's code to fix #3493 - I replicated the issue and verified that this fixed it on my local.
---
src/index.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/index.rs b/src/index.rs
index b3e26e02d0..d7a272b15f 100644
--- a/src/index.rs
+++ b/src/index.rs
@@ -1660,7 +1660,7 @@ impl Index {
return Ok(false);
};
- if !info.in_active_chain.unwrap_or_default() {
+ if info.blockhash.is_none() {
return Ok(false);
}
From 2eb09fb4f4d93b2e2a1879bf73d244ae385fd5a3 Mon Sep 17 00:00:00 2001
From: nine
Date: Sun, 19 May 2024 18:02:40 -0400
Subject: [PATCH 03/21] Updated runes_are_displayed_on_rune_page test to
account for new html fields
---
src/subcommand/server.rs | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs
index 2a0c3706f6..8b42cf8868 100644
--- a/src/subcommand/server.rs
+++ b/src/subcommand/server.rs
@@ -2906,13 +2906,19 @@ mod tests {
1
mint
no
-
supply
+
current supply
340282366920938463463374607431768211455\u{A0}%
-
premine
+
maximum supply
+
Unable to calculate maximum supply
+
supply progress
+
Unable to calculate supply progress
+
premine
340282366920938463463374607431768211455\u{A0}%
-
premine percentage
+
premine percentage of current supply
100%
-
burned
+
premine percentage of maximum supply
+
Unable to calculate premine percentage of maximum supply
+
burned
0\u{A0}%
divisibility
0
From 273b432f994bd419221380d070e7ab386f5f7af9 Mon Sep 17 00:00:00 2001
From: nine <118634361+cryptoni9n@users.noreply.github.com>
Date: Mon, 20 May 2024 16:07:19 -0400
Subject: [PATCH 04/21] Update rune.html
reverting changes for test troubleshooting
From 2b58a7bd3011e719107bdbda655df7d4d5c4f762 Mon Sep 17 00:00:00 2001
From: nine <118634361+cryptoni9n@users.noreply.github.com>
Date: Mon, 20 May 2024 16:12:32 -0400
Subject: [PATCH 05/21] Update rune.html
real revert to 0.18.5 rune.html
---
templates/rune.html | 27 ++-------------------------
1 file changed, 2 insertions(+), 25 deletions(-)
diff --git a/templates/rune.html b/templates/rune.html
index cf3c0cc06e..98a9b1ac00 100644
--- a/templates/rune.html
+++ b/templates/rune.html
@@ -50,35 +50,12 @@
{{ self.entry.spaced_rune }}
%% } else {
no
%% }
-
current supply
+
supply
{{ self.entry.pile(self.entry.supply()) }}
- %% if let Some(terms) = self.entry.terms {
- %% if let Some(symbol) = self.entry.symbol {
-
maximum supply
-
{{ (terms.cap.unwrap_or_default() * terms.amount.unwrap_or_default()) + self.entry.premine }}{{ symbol }}
- %% } } else {
-
maximum supply
-
Unable to calculate maximum supply
- %% }
- %% if let Some(terms) = self.entry.terms {
- %% if let Some(symbol) = self.entry.symbol {
-
supply progress
-
{{ self.entry.pile(self.entry.supply()) }} of {{ (terms.cap.unwrap_or_default() * terms.amount.unwrap_or_default()) + self.entry.premine }}{{ symbol }}
- %% } } else {
-
supply progress
-
Unable to calculate supply progress
- %% }
premine
{{ self.entry.pile(self.entry.premine) }}
-
premine percentage of current supply
+
premine percentage
{{ Decimal { value: ((self.entry.premine as f64 / self.entry.supply() as f64) * 10000.0) as u128, scale: 2 } }}%
- %% if let Some(terms) = self.entry.terms {
-
premine percentage of maximum supply
-
{{ Decimal { value: ((self.entry.premine as f64 / ((terms.cap.unwrap_or_default() as f64 * terms.amount.unwrap_or_default() as f64) + self.entry.premine as f64)) * 10000.0) as u128, scale: 2 } }}%
- %% } else {
-
premine percentage of maximum supply
-
Unable to calculate premine percentage of maximum supply
- %% }
burned
{{ self.entry.pile(self.entry.burned) }}
divisibility
From ae7696b4763a10ce8ebfa3ae359d578671ba470e Mon Sep 17 00:00:00 2001
From: nine <118634361+cryptoni9n@users.noreply.github.com>
Date: Mon, 20 May 2024 16:20:15 -0400
Subject: [PATCH 06/21] Revert server.rs test case for troubleshooting
From 1c28cc9f9ecf3a7ce3ad33c72481c5255add6de1 Mon Sep 17 00:00:00 2001
From: nine <118634361+cryptoni9n@users.noreply.github.com>
Date: Mon, 20 May 2024 16:25:42 -0400
Subject: [PATCH 07/21] reverting server.rs tests
---
src/subcommand/server.rs | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs
index 8b42cf8868..2a0c3706f6 100644
--- a/src/subcommand/server.rs
+++ b/src/subcommand/server.rs
@@ -2906,19 +2906,13 @@ mod tests {
1
mint
no
-
current supply
+
supply
340282366920938463463374607431768211455\u{A0}%
-
maximum supply
-
Unable to calculate maximum supply
-
supply progress
-
Unable to calculate supply progress
-
premine
+
premine
340282366920938463463374607431768211455\u{A0}%
-
premine percentage of current supply
+
premine percentage
100%
-
premine percentage of maximum supply
-
Unable to calculate premine percentage of maximum supply
-
burned
+
burned
0\u{A0}%
divisibility
0
From f45380b759fcf0300bfa55a4351e6ef96f65cc8a Mon Sep 17 00:00:00 2001
From: nine <118634361+cryptoni9n@users.noreply.github.com>
Date: Wed, 22 May 2024 14:49:05 -0400
Subject: [PATCH 08/21] adding mint_progress to rune.html
adding new field `mint progress` to rune.html to show the current supply of max supply ratio.
---
templates/rune.html | 2 ++
1 file changed, 2 insertions(+)
diff --git a/templates/rune.html b/templates/rune.html
index 98a9b1ac00..5844699351 100644
--- a/templates/rune.html
+++ b/templates/rune.html
@@ -52,6 +52,8 @@
{{ self.entry.spaced_rune }}
%% }
supply
{{ self.entry.pile(self.entry.supply()) }}
+
mint progress
+
{{ self.entry.pile(self.entry.supply()) }} of {{ self.entry.pile(self.entry.max_supply()) }}
premine
{{ self.entry.pile(self.entry.premine) }}
premine percentage
From b535d944bca047ea47d634852230f47c2aaa212b Mon Sep 17 00:00:00 2001
From: nine <118634361+cryptoni9n@users.noreply.github.com>
Date: Wed, 22 May 2024 14:52:12 -0400
Subject: [PATCH 09/21] Update batch function in lib.rs
update batch function to account for new `mint_progress` field
---
tests/lib.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/lib.rs b/tests/lib.rs
index 8c53a04cd3..54ddb810bd 100644
--- a/tests/lib.rs
+++ b/tests/lib.rs
@@ -334,6 +334,8 @@ fn batch(core: &mockcore::Handle, ord: &TestServer, batchfile: batch::File) -> E
{}
supply
{premine} {symbol}
+
mint progress
+
{premine} {symbol} of ({supply}) {symbol}
premine
{premine} {symbol}
premine percentage
From fb4c6085b99e29abd4b5408571d499f904fac077 Mon Sep 17 00:00:00 2001
From: nine <118634361+cryptoni9n@users.noreply.github.com>
Date: Wed, 22 May 2024 14:54:24 -0400
Subject: [PATCH 10/21] add max_supply function to entry.rs
added fn max_supply
---
src/index/entry.rs | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/index/entry.rs b/src/index/entry.rs
index faa3d2343a..26807e68f4 100644
--- a/src/index/entry.rs
+++ b/src/index/entry.rs
@@ -92,6 +92,16 @@ impl RuneEntry {
.unwrap_or_default()
}
+ pub fn max_supply(&self) -> u128 {
+ let cap = self.terms.map_or(0, |terms| terms.cap.unwrap_or_default());
+ self.premine
+ + cap
+ * self
+ .terms
+ .and_then(|terms| terms.amount)
+ .unwrap_or_default()
+ }
+
pub fn pile(&self, amount: u128) -> Pile {
Pile {
amount,
From e72ef173b4467311baf348ee5f32f0b083527889 Mon Sep 17 00:00:00 2001
From: nine <118634361+cryptoni9n@users.noreply.github.com>
Date: Wed, 22 May 2024 14:56:55 -0400
Subject: [PATCH 11/21] update runes_are_displayed_on_rune_page test in
server.rs
added mint_progress to runes_are_displayed_on_rune_page test
---
src/subcommand/server.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs
index 2a0c3706f6..15c05046d6 100644
--- a/src/subcommand/server.rs
+++ b/src/subcommand/server.rs
@@ -2908,6 +2908,8 @@ mod tests {
no
supply
340282366920938463463374607431768211455\u{A0}%
+
mint progress
+
340282366920938463463374607431768211455\u{A0}% of 340282366920938463463374607431768211455\u{A0}%
premine
340282366920938463463374607431768211455\u{A0}%
premine percentage
From e0def19dc576212048baf3f125de31f0f64c3a80 Mon Sep 17 00:00:00 2001
From: nine <118634361+cryptoni9n@users.noreply.github.com>
Date: Wed, 22 May 2024 14:58:23 -0400
Subject: [PATCH 12/21] Update display test in rune.rs
added `mint_progress` to display test
---
src/templates/rune.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/templates/rune.rs b/src/templates/rune.rs
index c4333315fa..b818c1437b 100644
--- a/src/templates/rune.rs
+++ b/src/templates/rune.rs
@@ -85,6 +85,8 @@ mod tests {
supply
100.123456889\u{A0}%
+
mint progress
+
100.123456889\u{A0}% of 101.12345689\u{A0}%
premine
0.123456789\u{A0}%
premine percentage
From 3dfda24d68aff79a60017087dcdc4e66a8141e0c Mon Sep 17 00:00:00 2001
From: nine <118634361+cryptoni9n@users.noreply.github.com>
Date: Wed, 22 May 2024 15:10:49 -0400
Subject: [PATCH 13/21] cargo fmt fix for entry.rs
bad indent
---
src/index/entry.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/index/entry.rs b/src/index/entry.rs
index 26807e68f4..f2688906d2 100644
--- a/src/index/entry.rs
+++ b/src/index/entry.rs
@@ -92,7 +92,7 @@ impl RuneEntry {
.unwrap_or_default()
}
- pub fn max_supply(&self) -> u128 {
+ pub fn max_supply(&self) -> u128 {
let cap = self.terms.map_or(0, |terms| terms.cap.unwrap_or_default());
self.premine
+ cap
From cb25d931272afd0536666e76673a6f9705d8f0e8 Mon Sep 17 00:00:00 2001
From: nine <118634361+cryptoni9n@users.noreply.github.com>
Date: Thu, 23 May 2024 16:13:06 -0400
Subject: [PATCH 14/21] Update rune.html
changing mint progress to percentage
---
templates/rune.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/rune.html b/templates/rune.html
index 5844699351..a45aecaff1 100644
--- a/templates/rune.html
+++ b/templates/rune.html
@@ -53,7 +53,7 @@
{{ self.entry.spaced_rune }}
supply
{{ self.entry.pile(self.entry.supply()) }}
mint progress
-
{{ self.entry.pile(self.entry.supply()) }} of {{ self.entry.pile(self.entry.max_supply()) }}
+
{{ Decimal { value: ((self.entry.supply() as f64 / self.entry.max_supply() as f64) * 10000.0) as u128, scale: 2 } }}%
premine
{{ self.entry.pile(self.entry.premine) }}
premine percentage
From 92151a6b5e8f208bac787cd5ac72e6588beca0c9 Mon Sep 17 00:00:00 2001
From: nine <118634361+cryptoni9n@users.noreply.github.com>
Date: Thu, 23 May 2024 16:14:16 -0400
Subject: [PATCH 15/21] Update server.rs
changing `mint progress` to percentage
---
src/subcommand/server.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs
index 15c05046d6..354d59a0a4 100644
--- a/src/subcommand/server.rs
+++ b/src/subcommand/server.rs
@@ -2909,7 +2909,7 @@ mod tests {
supply
340282366920938463463374607431768211455\u{A0}%
mint progress
-
340282366920938463463374607431768211455\u{A0}% of 340282366920938463463374607431768211455\u{A0}%