Skip to content

Commit

Permalink
Show premine percentage (ordinals#3567)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphjaph authored Apr 18, 2024
1 parent 861c9d8 commit ea4f860
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2833,6 +2833,8 @@ mod tests {
<dd>340282366920938463463374607431768211455\u{A0}%</dd>
<dt>premine</dt>
<dd>340282366920938463463374607431768211455\u{A0}%</dd>
<dt>premine percentage</dt>
<dd>100%</dd>
<dt>burned</dt>
<dd>0\u{A0}%</dd>
<dt>divisibility</dt>
Expand Down
2 changes: 2 additions & 0 deletions src/templates/rune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ mod tests {
<dd>100.123456889\u{A0}%</dd>
<dt>premine</dt>
<dd>0.123456789\u{A0}%</dd>
<dt>premine percentage</dt>
<dd>0.12%</dd>
<dt>burned</dt>
<dd>123456789.123456789\u{A0}%</dd>
<dt>divisibility</dt>
Expand Down
2 changes: 2 additions & 0 deletions templates/rune.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ <h1>{{ self.entry.spaced_rune }}</h1>
<dd>{{ self.entry.pile(self.entry.supply()) }}</dd>
<dt>premine</dt>
<dd>{{ self.entry.pile(self.entry.premine) }}</dd>
<dt>premine percentage</dt>
<dd>{{ Decimal { value: ((self.entry.premine as f64 / self.entry.supply() as f64) * 10000.0) as u128, scale: 2 } }}%</dd>
<dt>burned</dt>
<dd>{{ self.entry.pile(self.entry.burned) }}</dd>
<dt>divisibility</dt>
Expand Down
2 changes: 2 additions & 0 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ fn batch(core: &mockcore::Handle, ord: &TestServer, batchfile: batch::File) -> E
<dd>{premine} {symbol}</dd>
<dt>premine</dt>
<dd>{premine} {symbol}</dd>
<dt>premine percentage</dt>
<dd>.*</dd>
<dt>burned</dt>
<dd>0 {symbol}</dd>
<dt>divisibility</dt>
Expand Down

0 comments on commit ea4f860

Please sign in to comment.