...
 
Commits (3)
......@@ -2,6 +2,15 @@
Functions
*/
DROP FUNCTION IF EXISTS getUnixtime;
DELIMITER $$
CREATE FUNCTION getUnixtime(in_timestamp bigint(20))
RETURNS BIGINT(20) DETERMINISTIC
BEGIN
RETURN (SELECT in_timestamp + 1407722400);
END$$
DELIMITER ;
DROP FUNCTION IF EXISTS getPoolMinedAmount;
DELIMITER $$
CREATE FUNCTION getPoolMinedAmount(in_id bigint(20))
......@@ -267,7 +276,7 @@ CREATE TABLE `mosr` (
INDEX `idx` (`db_id`,`recipient_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- DROP TABLE IF EXISTS mo;
-- DROP TABLE IF EXISTS ec_account;
CREATE TABLE `ec_account` (
`id` BIGINT(20) NOT NULL ,
`name` VARCHAR(100) NOT NULL,
......
......@@ -2,6 +2,15 @@
Functions
*/
DROP FUNCTION IF EXISTS getUnixtime;
DELIMITER $$
CREATE FUNCTION getUnixtime(in_timestamp bigint(20))
RETURNS BIGINT(20) DETERMINISTIC
BEGIN
RETURN (SELECT in_timestamp + 1407722400);
END$$
DELIMITER ;
DROP FUNCTION IF EXISTS getPoolMinedAmount;
DELIMITER $$
CREATE FUNCTION getPoolMinedAmount(in_id bigint(20))
......@@ -249,7 +258,7 @@ CREATE TABLE `mosr` (
INDEX `idx` (`db_id`,`recipient_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- DROP TABLE IF EXISTS mo;
-- DROP TABLE IF EXISTS ec_account;
CREATE TABLE `ec_account` (
`id` BIGINT(20) NOT NULL ,
`name` VARCHAR(100) NOT NULL,
......
This diff is collapsed.
......@@ -14,10 +14,10 @@ class BlockController extends AbstractController
const BlockListByIds = 'SELECT b.height,
CAST(b.id AS UNSIGNED) AS id,
b.timestamp + 1407722400 AS unixtime,
getUnixtime(b.timestamp) AS unixtime,
getRewardByHeight(b.height) AS reward,
FORMAT(b.total_fee / 100000000, 2) AS tx_fee,
FORMAT(b.total_amount / 100000000, 2) AS sent,
b.total_fee AS tx_fee,
b.total_amount AS sent,
bi.tx_count AS tx_count,
CAST(bi.generator_id AS UNSIGNED) AS forger,
af.name AS forger_name,
......@@ -35,9 +35,9 @@ class BlockController extends AbstractController
const BlockDetails = ' SELECT CAST(b.id AS UNSIGNED) AS id,
b.height,
bi.tx_count AS tx_count,
FORMAT(b.total_amount / 100000000, 2) AS sent,
FORMAT(b.total_fee / 100000000, 2) AS tx_fee,
b.timestamp + 1407722400 AS unixtime,
b.total_amount AS sent,
b.total_fee AS tx_fee,
getUnixtime(b.timestamp) AS unixtime,
CAST(bi.generator_id AS UNSIGNED) AS forger,
af.name AS forger_name,
CAST(bi.recipient_id AS UNSIGNED) AS pool,
......@@ -45,7 +45,7 @@ class BlockController extends AbstractController
(b.timestamp - pb.timestamp) AS generation_time,
b.base_target,
b.payload_length AS size,
b.nonce,
CAST(b.nonce AS UNSIGNED) as nonce,
b.version,
getRewardByHeight(b.height) AS reward,
b.block_signature,
......@@ -63,9 +63,9 @@ class BlockController extends AbstractController
const BlockDetailsHeight = ' SELECT CAST(b.id AS UNSIGNED) AS id,
b.height,
bi.tx_count AS tx_count,
FORMAT(b.total_amount / 1000 000 00, 2) AS sent,
FORMAT(b.total_fee / 100 000 000, 2) AS tx_fee,
b.timestamp + 1407722400 AS unixtime,
b.total_amount AS sent,
b.total_fee AS tx_fee,
getUnixtime(b.timestamp) AS unixtime,
CAST(bi.generator_id AS UNSIGNED) AS forger,
af.name AS forger_name,
CAST(bi.recipient_id AS UNSIGNED) AS pool,
......@@ -117,7 +117,7 @@ class BlockController extends AbstractController
*/
public function blockDetails($block_id) {
$con = $this->entityManager->getConnection();
// TODO: Fix TX Count!!
$stmt = $con->prepare(self::BlockDetails);
$stmt->bindValue(1, $block_id);
$stmt->execute();
......
This diff is collapsed.
......@@ -9,21 +9,21 @@
<tr><th>Account</th><td>{{ account.id | toRSAddress }}</td></tr>
<tr><th>Public Key</th><td>{{ account.public_key | str2bin }}</td></tr>
<tr><th>Name</th><td>{{ account.name }}</td></tr>
<tr><th>Balance</th><td>{{ account.balance }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Balance</th><td>{{ account.balance | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Recieved</th>
<td>
{{ ((account.burst_recieved + account.mo_recieved + account.mos_recieved) / 100000000) | number_format(2, '.', ',') }} {{ getEnv('RS_PREFIX') }} in
{{ (account.burst_recieved + account.mo_recieved + account.mos_recieved) | planckToBurst }} {{ getEnv('RS_PREFIX') }} in
{{ account.tx_in_count }} transactions
</td>
</tr>
<tr><th>Sent</th><td>{{ account.burst_sent }} {{ getEnv('RS_PREFIX') }} in {{ account.tx_out_count }} transactions</td></tr>
<tr><th>Transaction Fees</th><td>{{ account.fees_paid }} {{ getEnv('RS_PREFIX') }} paid</td></tr>
<tr><th>Pool Mined</th><td>{{ account.pool_mined_amount | number_format(2, '.', ',') }} {{ getEnv('RS_PREFIX') }}</td></tr>
{% if account.is_pool %} }
<tr><th>Solo Mined</th><td>{{ (account.solo_mined_amount - account.rewarded_amount) | number_format(2, '.', ',') }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Rewarded</th><td>{{ account.rewarded_amount | number_format(2, '.', ',') }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Sent</th><td>{{ account.burst_sent | planckToBurst }} {{ getEnv('RS_PREFIX') }} in {{ account.tx_out_count }} transactions</td></tr>
<tr><th>Transaction Fees</th><td>{{ account.fees_paid | planckToBurst }} {{ getEnv('RS_PREFIX') }} paid</td></tr>
<tr><th>Pool Mined</th><td>{{ account.pool_mined_amount | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td></tr>
{% if account.is_pool %}
<tr><th>Solo Mined</th><td>{{ (account.solo_mined_amount - account.rewarded_amount) | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Rewarded</th><td>{{ account.rewarded_amount | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td></tr>
{% else %}
<tr><th>Solo Mined</th><td>{{ account.solo_mined_amount | number_format(2, '.', ',') }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Solo Mined</th><td>{{ account.solo_mined_amount | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td></tr>
{% endif %}
{% if account.pool_id is not null and account.pool_id != account.id %}
<tr><th>Pool</th>
......@@ -46,14 +46,26 @@
<div class="col-md-10">
<ul class="nav nav-tabs" id="accountTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="tx-tab" data-toggle="tab" href="#tx" role="tab" aria-controls="tx" aria-selected="true">Transactions ({{ account.tx_total_count }})</a>
<a class="nav-link" id="tx-tab" data-toggle="tab" href="#tx" role="tab" aria-controls="tx" aria-selected="true">Transactions ({{ account.tx_total_count }})</a>
</li>
<li class="nav-item">
<a class="nav-link active" id="forged-tab" data-toggle="tab" href="#forged" role="tab" aria-controls="forged" aria-selected="true">Forged Blocks ({{ account.forged_count }})</a>
</li>
<li class="nav-item">
<a class="nav-link" id="rewarded-tab" data-toggle="tab" href="#rewarded" role="tab" aria-controls="rewarded" aria-selected="true">Rewarded Blocks ({{ account.rewarded_count }})</a>
</li>
<li class="nav-item">
<a class="nav-link" id="asset-tab" data-toggle="tab" href="#asset" role="tab" aria-controls="asset" aria-selected="false">Asset Transfers</a>
</li>
</ul>
<div class="tab-content" id="accountTabContent">
<div class="tab-pane fade show active" id="tx" role="tabpanel" aria-labelledby="tx-tab">
<div class="tab-pane fade show active" id="forged" role="tabpanel" aria-labelledby="forged-tab">
<div class="include-html" id="forged-list" include-html="{{ url('account_details_forged', {'id': account.id }) }}">Loading....</div>
</div>
<div class="tab-pane fade show" id="rewarded" role="tabpanel" aria-labelledby="rewarded-tab">
<div class="include-html" id="rewarded-list" include-html="{{ url('account_details_rewarded', {'id': account.id }) }}">Loading....</div>
</div>
<div class="tab-pane fade show" id="tx" role="tabpanel" aria-labelledby="tx-tab">
<div class="include-html" id="tx-list" include-html="{{ url('transactions_by_accountId', {'id': account.id }) }}">Loading.... <small>large amounts of Transactions may take up to 20s</small></div>
</div>
<div class="tab-pane fade" id="asset" role="tabpanel" aria-labelledby="asset-tab">Asset, to be done</div>
......
......@@ -8,8 +8,8 @@
<table class="table table-striped table-hover table-sm">
<tr><th>Height</th><td>{{ block.height }}</td></tr>
<tr><th>Number of Transactions</th><td>{{ block.tx_count }}</td></tr>
<tr><th>Total Amount sent</th><td>{{ block.sent }}</td></tr>
<tr><th>Transaction Fees</th><td>{{ block.tx_fee }}</td></tr>
<tr><th>Total Amount sent</th><td>{{ block.sent | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Transaction Fees</th><td>{{ block.tx_fee | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Timestamp</th><td>{{ block.unixtime | date ("Y-m-d H:i:s", "Europe/Berlin") }}</td></tr>
<tr><th>Forger</th>
<td>
......
......@@ -46,8 +46,8 @@
<tr>
<td><a href="{{ path('block_details', {'block_id': block.id}) }}">{{ block.height }}</a></td>
<td>{{ block.unixtime | date ("Y-m-d H:i:s", "Europe/Berlin") }}</td>
<td>{{ block.reward }} + {{ block.tx_fee }}</td>
<td>{{ block.sent }}</td>
<td>{{ block.reward }} + {{ block.tx_fee | planckToBurst }}</td>
<td>{{ block.sent | planckToBurst }}</td>
<td>{{ block.tx_count }}</td>
<td>
{% if block.pool == block.forger %}
......
<ul class="pagination">
{% if 0 not in pageLinks %}
<li class="page-item"><a class="page-link" href="#" onclick="nextPage('{{ list_name }}', '{{ path(route, {'page': 0, 'id': id }) }}')">1</a></li>
<li class="page-item"><span class="page-link">&nbsp;</span></li>
{% endif %}
{% if current_page != 0 %}
<li class="page-item"><a class="page-link" href="#" onclick="nextPage('{{ list_name }}', '{{ path(route, {'page': current_page - 1, 'id': id }) }}')">&laquo;</a></li>
{% endif %}
{% for pageLink in pageLinks %}
{% if pageLink != current_page %}
<li class="page-item"><a class="page-link" href="#" onclick="nextPage('{{ list_name }}', '{{ path(route, {'page': pageLink, 'id': id }) }}')">{{ pageLink + 1 }}</a></li>
{% else %}
<li class="page-item active"><span class="page-link">{{ pageLink + 1 }}</span></li>
{% endif %}
{% endfor %}
{% if current_page != last_page %}
<li class="page-item"><a class="page-link" href="#" onclick="nextPage('{{ list_name }}', '{{ path(route, {'page': current_page + 1, 'id': id }) }}')">&raquo;</a></li>
<li class="page-item"><span class="page-link">&nbsp;</span></li>
<li class="page-item"><a class="page-link" href="#" onclick="nextPage('{{ list_name }}', '{{ path(route, {'page': last_page, 'id': id }) }}')">{{ last_page + 1 }}</a></li>
{% endif %}
</ul>
<table class="table table-striped table-bordered table-hover table-sm">
<thead>
<th style="position: sticky; top: 0; background-color: white;">Height</th>
<th style="position: sticky; top: 0; background-color: white;">Timestamp</th>
<th style="position: sticky; top: 0; background-color: white;">Reward</th>
<th style="position: sticky; top: 0; background-color: white;">Sent</th>
<th style="position: sticky; top: 0; background-color: white;">#TXs</th>
{% if forged %}<th style="position: sticky; top: 0; background-color: white;">Pool</th>{% else %}
<th style="position: sticky; top: 0; background-color: white;">Forger</th>{% endif %}
</thead>
<tbody>
{% for block in blocks %}
<tr>
<td><a href="{{ path('block_details', {'block_id': block.id}) }}">{{ block.height }}</a></td>
<td>{{ block.unixtime | date ("Y-m-d H:i:s", "Europe/Berlin") }}</td>
<td>{{ block.reward }} + {{ block.tx_fee | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td>
<td>{{ block.sent | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td>
<td>{{ block.tx_count }}</td>
{% if forged %}
<td>
{% if block.pool == block.forger %}
<span style="color: orangered;">( Solo )</span>
{% else %}
<a href="{{ path('account_details', {id: block.pool |toAccountId }) }}">
{% if block.pool_name is not null%}
{{ block.pool_name }}
{% else %}
{{ block.pool | toRSAddress }}
{% endif %}
</a>
{% endif %}
</td>
{% else %}
<td><a href="{{ path('account_details', {id: block.forger | toAccountId }) }}">
{% if block.forger_name is not null %}
{{ block.forger_name }}
{% else %}
{{ block.forger | toRSAddress }}
{% endif %}
</a></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
\ No newline at end of file
......@@ -31,7 +31,7 @@
</tr>
{% endfor %}
</table>
{% else %}
{% elseif transaction.recipient_id is not null %}
<a href="{{ path('account_details', {id: transaction.recipient_id | toAccountId }) }}">
{{ transaction.recipient_id | toRSAddress }}<br />{{ transaction.recipient_name }}
</a>
......
......@@ -66,12 +66,10 @@
<a href="{{ path('account_details', {id: transaction.recipient_id | toAccountId }) }}">
{{ transaction.recipient_id | toRSAddress }}<br />{{ transaction.recipient_name }}
</a>
{% else %}
Multiple Recipients, <a href="{{ path('transaction_details', {'id': transaction.id}) }}">Details</a>
{% endif %}
</td>
<td>{{ transaction.amount }}</td>
<td>{{ transaction.fee }}</td>
<td>{{ transaction.amount | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td>
<td>{{ transaction.fee | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td>
{% if route != "transactions_by_height" and route != "transactions_by_blockId" %}
<td><a href="{{ url('block_details', {'block_id': transaction.block_id}) }}">#{{ transaction.height }}</a></td>
{% endif %}
......