+ <%= if @transaction.value.value != 0 do %>
+
<%= gettext "Ether" %> <%= gettext "Value" %>
+
+
+ <%= value(@transaction) %>
+
+ <%= if !empty_exchange_rate?(@exchange_rate) do %>
+
+ data-usd-exchange-rate=<%= @exchange_rate.usd_value %>>
+
+ <% end %>
+
+ <% end %>
<%= token_type_name(type)%><%= gettext " Token Transfer" %>
<%= for transfer <- aggregate_token_transfers(transaction_with_transfers.token_transfers) do %>
<%= token_transfer_amount(transfer) %>
+ <%= " "%>
<%= link(token_symbol(transfer.token), to: token_path(BlockScoutWeb.Endpoint, :show, transfer.token.contract_address_hash)) %>
diff --git a/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex b/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex
index 53d64555dd..7ac564fae3 100644
--- a/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex
+++ b/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex
@@ -36,7 +36,7 @@ defmodule BlockScoutWeb.TransactionView do
transaction_with_transfers = Repo.preload(transaction, token_transfers: :token)
type = Chain.transaction_token_transfer_type(transaction)
- if type, do: {type, transaction_with_transfers}
+ if type, do: {type, transaction_with_transfers}, else: {nil, transaction_with_transfers}
end
def aggregate_token_transfers(token_transfers) do
@@ -83,7 +83,7 @@ defmodule BlockScoutWeb.TransactionView do
case type do
:erc20 -> gettext("ERC-20 ")
:erc721 -> gettext("ERC-721 ")
- :token_transfer -> ""
+ _ -> ""
end
end
diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot
index ab75f8d4a3..a9ae555cb1 100644
--- a/apps/block_scout_web/priv/gettext/default.pot
+++ b/apps/block_scout_web/priv/gettext/default.pot
@@ -199,11 +199,13 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:253
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:47
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:54
msgid "Cancel"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:137
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:106
msgid "Clear"
msgstr ""
@@ -220,6 +222,8 @@ msgstr ""
#: lib/block_scout_web/templates/address/_tabs.html.eex:42
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:165
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:187
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:126
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:149
#: lib/block_scout_web/views/address_view.ex:307
msgid "Code"
msgstr ""
@@ -325,18 +329,22 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:146
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:116
msgid "Curl"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:53
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:188
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:60
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:150
msgid "Description"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:8
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:166
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:127
msgid "Details"
msgstr ""
@@ -371,18 +379,21 @@ msgstr ""
#: lib/block_scout_web/templates/layout/app.html.eex:56
#: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:20
#: lib/block_scout_web/templates/transaction/_tile.html.eex:30
-#: lib/block_scout_web/templates/transaction/overview.html.eex:196
+#: lib/block_scout_web/templates/transaction/overview.html.eex:179
+#: lib/block_scout_web/templates/transaction/overview.html.eex:211
#: lib/block_scout_web/views/wei_helpers.ex:78
msgid "Ether"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:211
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:164
msgid "Example Value"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:128
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:99
msgid "Execute"
msgstr ""
@@ -483,7 +494,7 @@ msgid "Less than"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/transaction/overview.html.eex:224
+#: lib/block_scout_web/templates/transaction/overview.html.eex:239
msgid "Limit"
msgstr ""
@@ -549,6 +560,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:50
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:52
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:59
#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:19
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:52
msgid "Name"
@@ -583,11 +595,13 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:19
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:26
msgid "POST"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:33
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:40
msgid "Parameters"
msgstr ""
@@ -652,11 +666,13 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:173
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:134
msgid "Response Body"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:185
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:147
msgid "Responses"
msgstr ""
@@ -675,6 +691,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:163
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:124
msgid "Server Response"
msgstr ""
@@ -877,6 +894,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:40
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:47
msgid "Try it out"
msgstr ""
@@ -897,7 +915,7 @@ msgid "Unique Token"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/transaction/overview.html.eex:218
+#: lib/block_scout_web/templates/transaction/overview.html.eex:233
msgid "Used"
msgstr ""
@@ -917,7 +935,8 @@ msgid "Validations"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/transaction/overview.html.eex:196
+#: lib/block_scout_web/templates/transaction/overview.html.eex:179
+#: lib/block_scout_web/templates/transaction/overview.html.eex:211
msgid "Value"
msgstr ""
@@ -996,6 +1015,7 @@ msgstr ""
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:58
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:69
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:81
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:70
msgid "required"
msgstr ""
@@ -1492,7 +1512,7 @@ msgid "View All Transactions"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/transaction/overview.html.eex:214
+#: lib/block_scout_web/templates/transaction/overview.html.eex:229
msgid "Gas"
msgstr ""
@@ -1641,7 +1661,7 @@ msgid "New Smart Contract Verification"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/transaction/overview.html.eex:178
+#: lib/block_scout_web/templates/transaction/overview.html.eex:192
msgid " Token Transfer"
msgstr ""
diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
index 1aa6251b40..2c910e276e 100644
--- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
+++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
@@ -199,11 +199,13 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:253
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:47
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:54
msgid "Cancel"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:137
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:106
msgid "Clear"
msgstr ""
@@ -220,6 +222,8 @@ msgstr ""
#: lib/block_scout_web/templates/address/_tabs.html.eex:42
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:165
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:187
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:126
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:149
#: lib/block_scout_web/views/address_view.ex:307
msgid "Code"
msgstr ""
@@ -325,18 +329,22 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:146
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:116
msgid "Curl"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:53
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:188
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:60
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:150
msgid "Description"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:8
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:166
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:127
msgid "Details"
msgstr ""
@@ -371,18 +379,21 @@ msgstr ""
#: lib/block_scout_web/templates/layout/app.html.eex:56
#: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:20
#: lib/block_scout_web/templates/transaction/_tile.html.eex:30
-#: lib/block_scout_web/templates/transaction/overview.html.eex:196
+#: lib/block_scout_web/templates/transaction/overview.html.eex:179
+#: lib/block_scout_web/templates/transaction/overview.html.eex:211
#: lib/block_scout_web/views/wei_helpers.ex:78
msgid "Ether"
msgstr "POA"
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:211
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:164
msgid "Example Value"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:128
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:99
msgid "Execute"
msgstr ""
@@ -483,7 +494,7 @@ msgid "Less than"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/transaction/overview.html.eex:224
+#: lib/block_scout_web/templates/transaction/overview.html.eex:239
msgid "Limit"
msgstr ""
@@ -549,6 +560,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:50
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:52
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:59
#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:19
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:52
msgid "Name"
@@ -583,11 +595,13 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:19
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:26
msgid "POST"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:33
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:40
msgid "Parameters"
msgstr ""
@@ -652,11 +666,13 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:173
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:134
msgid "Response Body"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:185
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:147
msgid "Responses"
msgstr ""
@@ -675,6 +691,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:163
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:124
msgid "Server Response"
msgstr ""
@@ -877,6 +894,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:40
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:47
msgid "Try it out"
msgstr ""
@@ -897,7 +915,7 @@ msgid "Unique Token"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/transaction/overview.html.eex:218
+#: lib/block_scout_web/templates/transaction/overview.html.eex:233
msgid "Used"
msgstr ""
@@ -917,7 +935,8 @@ msgid "Validations"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/transaction/overview.html.eex:196
+#: lib/block_scout_web/templates/transaction/overview.html.eex:179
+#: lib/block_scout_web/templates/transaction/overview.html.eex:211
msgid "Value"
msgstr ""
@@ -996,6 +1015,7 @@ msgstr ""
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:58
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:69
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:81
+#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:70
msgid "required"
msgstr ""
@@ -1493,7 +1513,7 @@ msgid "View All Transactions"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/transaction/overview.html.eex:214
+#: lib/block_scout_web/templates/transaction/overview.html.eex:229
msgid "Gas"
msgstr ""
@@ -1642,7 +1662,7 @@ msgid "New Smart Contract Verification"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/transaction/overview.html.eex:178
+#: lib/block_scout_web/templates/transaction/overview.html.eex:192
msgid " Token Transfer"
msgstr ""
diff --git a/apps/explorer/lib/explorer/eth_rpc.ex b/apps/explorer/lib/explorer/eth_rpc.ex
index e0864ac279..04d257ffb1 100644
--- a/apps/explorer/lib/explorer/eth_rpc.ex
+++ b/apps/explorer/lib/explorer/eth_rpc.ex
@@ -12,11 +12,30 @@ defmodule Explorer.EthRPC do
"eth_getBalance" => %{
action: :eth_get_balance,
notes: """
- the `earliest` parameter will not work as expected currently, because genesis block balances
+ The `earliest` parameter will not work as expected currently, because genesis block balances
are not currently imported
""",
example: """
- {"id": 0, "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x0000000000000000000000000000000000000007", "2"]}
+ {"id": 0, "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x0000000000000000000000000000000000000007", "latest"]}
+ """,
+ params: [
+ %{
+ name: "Data",
+ description: "20 Bytes - address to check for balance",
+ type: "string",
+ default: nil,
+ required: true
+ },
+ %{
+ name: "Quantity|Tag",
+ description: "Integer block number, or the string \"latest\", \"earliest\" or \"pending\"",
+ type: "string",
+ default: "latest",
+ required: true
+ }
+ ],
+ result: """
+ {"id": 0, "jsonrpc": "2.0", "result": "0x0234c8a3397aab58"}
"""
},
"eth_getLogs" => %{
@@ -33,6 +52,25 @@ defmodule Explorer.EthRPC do
"fromBlock": "earliest",
"toBlock": "latest",
"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}]}
+ """,
+ params: [
+ %{name: "Object", description: "The filter options", type: "json", default: nil, required: true}
+ ],
+ result: """
+ {
+ "id":0,
+ "jsonrpc":"2.0",
+ "result": [{
+ "logIndex": "0x1",
+ "blockNumber":"0x1b4",
+ "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d",
+ "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf",
+ "transactionIndex": "0x0",
+ "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d",
+ "data":"0x0000000000000000000000000000000000000000000000000000000000000000",
+ "topics": ["0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5"]
+ }]
+ }
"""
}
}
diff --git a/apps/explorer/priv/repo/migrations/20190807111216_remove_duplicate_indexes.exs b/apps/explorer/priv/repo/migrations/20190807111216_remove_duplicate_indexes.exs
new file mode 100644
index 0000000000..ae07c8b1e5
--- /dev/null
+++ b/apps/explorer/priv/repo/migrations/20190807111216_remove_duplicate_indexes.exs
@@ -0,0 +1,17 @@
+defmodule Explorer.Repo.Migrations.RemoveDuplicateIndexes do
+ use Ecto.Migration
+
+ def change do
+ drop_if_exists(
+ index(:decompiled_smart_contracts, [:address_hash], name: "decompiled_smart_contracts_address_hash_index")
+ )
+
+ drop_if_exists(
+ index(:staking_pools_delegators, [:delegator_address_hash],
+ name: "staking_pools_delegators_delegator_address_hash_index"
+ )
+ )
+
+ drop_if_exists(index(:transactions, [:to_address_hash], name: "transactions_to_address_hash_index"))
+ end
+end