diff --git a/observer.py b/observer.py index e06fe83..3723588 100644 --- a/observer.py +++ b/observer.py @@ -525,6 +525,12 @@ def show_tx(txid, more_details=False): ) tx = parse_txs(txs)[0] + # If this is a state change, see if we have the quorum stored to provide context + testing_quorum = None + if tx['info']['version'] >= 4 and 'sn_state_change' in tx['extra']: + testing_quorum = FutureJSON(lmq, lokid, 'rpc.get_quorum_state', 60, cache_key='tx_state_change', + args={ 'quorum_type': 0, 'start_height': tx['extra']['sn_state_change']['height'] }) + kindex_info = {} # { amount => { keyindex => {output-info} } } block_info_req = None if 'vin' in tx['info']: @@ -582,11 +588,20 @@ def show_tx(txid, more_details=False): for bh in bi['block_headers']: block_info[bh['height']] = bh + + if testing_quorum: + testing_quorum = testing_quorum.get() + if 'quorums' in testing_quorum and testing_quorum['quorums']: + testing_quorum = testing_quorum['quorums'][0]['quorum'] + else: + testing_quorum = None + return flask.render_template('tx.html', info=info.get(), tx=tx, kindex_info=kindex_info, block_info=block_info, + testing_quorum=testing_quorum, **more_details, ) diff --git a/static/style.css b/static/style.css index fd2199d..3d874dd 100644 --- a/static/style.css +++ b/static/style.css @@ -415,6 +415,26 @@ td.quorum-pubkey span { text-align: left; } +div.tx-state-change-quorum div.workers { + border-top: 2px solid #008522; +} +div.tx-state-change-quorum div.validators .sn.voted, +div.tx-state-change-quorum div.workers .sn.testee { + background-color: #006a1b; + border-color: #78be20; + color: #78be20; +} +.quorums div.tx-state-change-quorum .sn:hover { + background-color: #78be20 !important; + border-color: #006a1b !important; + color: #006a1b !important; +} + +/*div.tx-state-change-quorum>div>.sn { + flex-basis: 100px; +}*/ + + th.subheader { text-align: left; border-bottom: 2px solid #008522; diff --git a/templates/tx.html b/templates/tx.html index 34f9d75..658eca4 100644 --- a/templates/tx.html +++ b/templates/tx.html @@ -94,33 +94,42 @@ {% endif -%} - {#FIXME -- all the values below need to be fixed#}
- {%if state_change_have_pubkey_info%} -

Service Node Public Key: {{state_change_service_node_pubkey}}

+ {%set sn_index = tx.extra.sn_state_change.index%} + {%if testing_quorum%} +

Service Node Public Key: {{testing_quorum.workers[sn_index]}}

+
+
+

Testing quorum {{tx.extra.sn_state_change.height}}

+ + {%set voters = tx.extra.sn_state_change.voters%} +
+ + {%for v in testing_quorum.validators%} + {{v}} + {%endfor%} +
+
+ + {%for w in testing_quorum.workers%} + {{w}} + {%endfor%} +
+
+
+ {%else%} +
+

Service Node Index: {{sn_index}}

+

Testing quorum: {{tx.extra.sn_state_change.height}}

+
{%endif%} -

Service Node Index: {{state_change_service_node_index}}

-

Block Height: {{state_change_block_height}}

- - - - - {%if state_change_have_pubkey_info%} - - {%endif%} - - - - {%if state_change_vote_array%} - - - {%if state_change_have_pubkey_info%} - - {%endif%} - - - {%endif%} -
Voters Quorum IndexVoter Public KeySignature
{{state_change_voters_quorum_index}}{{state_change_voter_pubkey}}{{state_change_signature}}
{% elif tx.info.type == 2 %}

🔓 Service Node Unlock

@@ -174,31 +183,33 @@ {% endif %} -

Outputs

-

{{tx.info.vout|length}} output(s) for total of - {{tx.info.vout | sum(attribute='amount') | loki(zero='???') | safe}}

-
-
- - - - - - - - - - - {%for out in tx.info.vout%} + {%if tx.info.vout%} +

Outputs

+

{{tx.info.vout|length}} output(s) for total of + {{tx.info.vout | sum(attribute='amount') | loki(zero='???') | safe}}

+
+
+
Stealth AddressAmountOutput Index
+ - - - + + + - {%endfor%} - -
{{out.target.key}}{{out.amount | loki(zero='?')}}{%if 'output_indices' in tx%}{{tx.output_indices[loop.index0]}}{# FIXME: of {{num_outputs}}#}{%endif%}Stealth AddressAmountOutput Index
-
+ + + + {%for out in tx.info.vout%} + + {{out.target.key}} + {{out.amount | loki(zero='?')}} + {%if 'output_indices' in tx%}{{tx.output_indices[loop.index0]}}{# FIXME: of {{num_outputs}}#}{%endif%} + + {%endfor%} + + + + {%endif%} {#FIXME {%if not have_raw_tx%}