* master: (21 commits) (update) changelog (fix) added style for more types of errors make token inventory async fix transaction internal transaction controller tests fix gettext make transacion internal transaction async (update) changelog (fix) txs errors color fix block transaction tests fix gettext make block transaction async fix gettext fix transaction token transfer tests add transaction token transfer tab async fix credo, gettext fix transaction log tests make transaction logs tab async fix: fix to/from filters on tx list pages fix address_token_controller tests make logs loading async ...pull/2263/head
commit
493a46c7be
@ -0,0 +1,54 @@ |
||||
<div data-test="transaction_log" class="tile tile-muted"> |
||||
<dl class="row"> |
||||
<dt class="col-md-2"> <%= gettext "Transaction" %> </dt> |
||||
<dd class="col-md-10"> |
||||
<h3 class=""> |
||||
<%= link( |
||||
@log.transaction, |
||||
to: transaction_path(@conn, :show, @log.transaction), |
||||
"data-test": "log_address_link", |
||||
"data-address-hash": @log.transaction |
||||
) %> |
||||
</h3> |
||||
</dd> |
||||
<dt class="col-md-2"><%= gettext "Topics" %></dt> |
||||
<dd class="col-md-10"> |
||||
<div class="raw-transaction-log-topics"> |
||||
<%= unless is_nil(@log.first_topic) do %> |
||||
<div class="text-dark"> |
||||
<span class="text-dark">[0]</span> |
||||
<%= @log.first_topic %> |
||||
</div> |
||||
<% end %> |
||||
<%= unless is_nil(@log.second_topic) do %> |
||||
<div class="text-dark"> |
||||
<span class="">[1] </span> |
||||
<%= @log.second_topic %> |
||||
</div> |
||||
<% end %> |
||||
<%= unless is_nil(@log.third_topic) do %> |
||||
<div class="text-dark"> |
||||
<span>[2]</span> |
||||
<%= @log.third_topic %> |
||||
</div> |
||||
<% end %> |
||||
<%= unless is_nil(@log.fourth_topic) do %> |
||||
<div class="text-dark"> |
||||
<span>[3]</span> |
||||
<%= @log.fourth_topic %> |
||||
</div> |
||||
<% end %> |
||||
</div> |
||||
</dd> |
||||
<dt class="col-md-2"> |
||||
<%= gettext "Data" %> |
||||
</dt> |
||||
<dd class="col-md-10"> |
||||
<%= unless is_nil(@log.data) do %> |
||||
<div class="text-dark raw-transaction-log-data"> |
||||
<%= @log.data %> |
||||
</div> |
||||
<% end %> |
||||
</dd> |
||||
</dl> |
||||
</div> |
@ -0,0 +1,123 @@ |
||||
<div data-test="transaction_log" class="tile tile-muted"> |
||||
<dl class="row"> |
||||
<dt class="col-md-1"> <%= gettext "Address" %> </dt> |
||||
<dd class="col-md-11"> |
||||
<h3 class=""> |
||||
<%= link( |
||||
@log.address, |
||||
to: address_path(@conn, :show, @log.address), |
||||
"data-test": "log_address_link", |
||||
"data-address-hash": @log.address |
||||
) %> |
||||
</h3> |
||||
</dd> |
||||
<dt class="col-md-1"><%= gettext "Decoded" %></dt> |
||||
<dd class="col-md-11"> |
||||
<%= case decode(@log, @transaction) do %> |
||||
<% {:error, :contract_not_verified} -> %> |
||||
<div class="alert alert-info"> |
||||
<%= gettext "To see decoded input data, the contract must be verified." %> |
||||
<%= case @transaction do %> |
||||
<% %{to_address: %{hash: hash}} -> %> |
||||
<%= gettext "Verify the contract " %><a href="<%= address_verify_contract_path(@conn, :new, hash)%>"><%= gettext "here" %></a> |
||||
<% _ -> %> |
||||
<%= nil %> |
||||
<% end %> |
||||
</div> |
||||
<% {:error, :could_not_decode} -> %> |
||||
<div class="alert alert-danger"> |
||||
<%= gettext "Failed to decode log data." %> |
||||
</div> |
||||
<% {:ok, method_id, text, mapping} -> %> |
||||
<table summary="Transaction Info" class="table thead-light table-bordered transaction-input-table"> |
||||
<tr> |
||||
<td>Method Id</td> |
||||
<td colspan="3"><code>0x<%= method_id %></code></td> |
||||
</tr> |
||||
<tr> |
||||
<td>Call</td> |
||||
<td colspan="3"><code><%= text %></code></td> |
||||
</tr> |
||||
</table> |
||||
<table style="color: black;" summary="<%= gettext "Log Data" %>" class="table thead-light table-bordered table-responsive"> |
||||
<tr> |
||||
<th scope="col"></th> |
||||
<th scope="col"><%= gettext "Name" %></th> |
||||
<th scope="col"><%= gettext "Type" %></th> |
||||
<th scope="col"><%= gettext "Indexed?" %></th> |
||||
<th scope="col"><%= gettext "Data" %></th> |
||||
<tr> |
||||
<%= for {name, type, indexed?, value} <- mapping do %> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= case BlockScoutWeb.ABIEncodedValueView.copy_text(type, value) do %> |
||||
<% :error -> %> |
||||
<%= nil %> |
||||
<% copy_text -> %> |
||||
<span |
||||
aria-label='<%= gettext "Copy Value" %>' |
||||
class="btn-copy-ico" |
||||
data-clipboard-text="<%= copy_text %>" |
||||
data-placement="top" |
||||
data-toggle="tooltip" |
||||
> |
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.5 32.5" width="32" height="32"> |
||||
<path fill-rule="evenodd" d="M23.5 20.5a1 1 0 0 1-1-1v-9h-9a1 1 0 0 1 0-2h10a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1zm-3-7v10a1 1 0 0 1-1 1h-10a1 1 0 0 1-1-1v-10a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1zm-2 1h-8v8h8v-8z"/> |
||||
</svg> |
||||
</span> |
||||
<% end %> |
||||
</th> |
||||
<td><%= name %></td> |
||||
<td><%= type %></td> |
||||
<td><%= indexed? %></td> |
||||
<td> |
||||
<pre class="transaction-input-text tile"><code><%= BlockScoutWeb.ABIEncodedValueView.value_html(type, value) %></code></pre> |
||||
</td> |
||||
</tr> |
||||
<% end %> |
||||
</table> |
||||
<% _ -> %> |
||||
<%= nil %> |
||||
<% end %> |
||||
|
||||
<dt class="col-md-1"><%= gettext "Topics" %></dt> |
||||
<dd class="col-md-11"> |
||||
<div class="raw-transaction-log-topics"> |
||||
<%= unless is_nil(@log.first_topic) do %> |
||||
<div class="text-dark"> |
||||
<span class="text-dark">[0]</span> |
||||
<%= @log.first_topic %> |
||||
</div> |
||||
<% end %> |
||||
<%= unless is_nil(@log.second_topic) do %> |
||||
<div class="text-dark"> |
||||
<span class="">[1] </span> |
||||
<%= @log.second_topic %> |
||||
</div> |
||||
<% end %> |
||||
<%= unless is_nil(@log.third_topic) do %> |
||||
<div class="text-dark"> |
||||
<span>[2]</span> |
||||
<%= @log.third_topic %> |
||||
</div> |
||||
<% end %> |
||||
<%= unless is_nil(@log.fourth_topic) do %> |
||||
<div class="text-dark"> |
||||
<span>[3]</span> |
||||
<%= @log.fourth_topic %> |
||||
</div> |
||||
<% end %> |
||||
</div> |
||||
</dd> |
||||
<dt class="col-md-1"> |
||||
<%= gettext "Data" %> |
||||
</dt> |
||||
<dd class="col-md-11"> |
||||
<%= unless is_nil(@log.data) do %> |
||||
<div class="text-dark raw-transaction-log-data"> |
||||
<%= @log.data %> |
||||
</div> |
||||
<% end %> |
||||
</dd> |
||||
</dl> |
||||
</div> |
Loading…
Reference in new issue