Merge branch 'master' into vb-fix-import-spec

pull/2990/head
Victor Baranov 5 years ago committed by GitHub
commit 7daf8826ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 32
      .circleci/config.yml
  2. 6
      .tool-versions
  3. 4
      CHANGELOG.md
  4. 9
      apps/block_scout_web/assets/js/lib/try_eth_api.js
  5. 10369
      apps/block_scout_web/assets/static/images/ethercore_logo.svg
  6. 7646
      apps/block_scout_web/assets/static/images/ethercore_testnet_logo.svg
  7. 0
      apps/block_scout_web/assets/static/manifest.webmanifest
  8. 3
      apps/block_scout_web/config/config.exs
  9. 3
      apps/block_scout_web/config/dev.exs
  10. 3
      apps/block_scout_web/config/prod.exs
  11. 4
      apps/block_scout_web/lib/block_scout_web/endpoint.ex
  12. 2
      apps/block_scout_web/lib/block_scout_web/templates/layout/app.html.eex
  13. 21
      apps/block_scout_web/lib/block_scout_web/views/api_docs_view.ex
  14. 5
      apps/block_scout_web/lib/block_scout_web/views/tokens/instance/overview_view.ex
  15. 4
      apps/block_scout_web/priv/gettext/default.pot
  16. 4
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  17. 6
      apps/block_scout_web/test/block_scout_web/views/api_docs_view_test.exs
  18. 2
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/parity/trace/action.ex
  19. 2
      docker/Dockerfile

@ -3,7 +3,7 @@ jobs:
build:
docker:
# Ensure .tool-versions matches
- image: circleci/elixir:1.9.1-node-browsers
- image: circleci/elixir:1.9.4-node-browsers
environment:
MIX_ENV: test
# match POSTGRES_PASSWORD for postgres image below
@ -63,6 +63,10 @@ jobs:
command: npm install
working_directory: "apps/block_scout_web/assets"
- run:
command: npm rebuild node-sass
working_directory: "apps/block_scout_web/assets"
- save_cache:
key: v7-npm-install-{{ .Branch }}-{{ checksum "apps/block_scout_web/assets/package-lock.json" }}
paths: "apps/block_scout_web/assets/node_modules"
@ -129,7 +133,7 @@ jobs:
check_formatted:
docker:
# Ensure .tool-versions matches
- image: circleci/elixir:1.9.1
- image: circleci/elixir:1.9.4
environment:
MIX_ENV: test
@ -143,7 +147,7 @@ jobs:
credo:
docker:
# Ensure .tool-versions matches
- image: circleci/elixir:1.9.1
- image: circleci/elixir:1.9.4
environment:
MIX_ENV: test
@ -177,7 +181,7 @@ jobs:
dialyzer:
docker:
# Ensure .tool-versions matches
- image: circleci/elixir:1.9.1
- image: circleci/elixir:1.9.4
environment:
MIX_ENV: test
@ -229,7 +233,7 @@ jobs:
eslint:
docker:
# Ensure .tool-versions matches
- image: circleci/node:12.13.0-browsers-legacy
- image: circleci/node:12.14.1-browsers-legacy
working_directory: ~/app
@ -247,7 +251,7 @@ jobs:
gettext:
docker:
# Ensure .tool-versions matches
- image: circleci/elixir:1.9.1
- image: circleci/elixir:1.9.4
environment:
MIX_ENV: test
@ -271,7 +275,7 @@ jobs:
jest:
docker:
# Ensure .tool-versions matches
- image: circleci/node:12.13.0-browsers-legacy
- image: circleci/node:12.14.1-browsers-legacy
working_directory: ~/app
@ -286,7 +290,7 @@ jobs:
release:
docker:
# Ensure .tool-versions matches
- image: circleci/elixir:1.9.1
- image: circleci/elixir:1.9.4
environment:
MIX_ENV: prod
@ -312,7 +316,7 @@ jobs:
sobelow:
docker:
# Ensure .tool-versions matches
- image: circleci/elixir:1.9.1
- image: circleci/elixir:1.9.4
environment:
MIX_ENV: test
@ -336,7 +340,7 @@ jobs:
# test_geth_http_websocket:
# docker:
# # Ensure .tool-versions matches
# - image: circleci/elixir:1.9.1-node-browsers
# - image: circleci/elixir:1.9.4-node-browsers
# environment:
# MIX_ENV: test
# # match POSTGRES_PASSWORD for postgres image below
@ -390,7 +394,7 @@ jobs:
# test_geth_mox:
# docker:
# # Ensure .tool-versions matches
# - image: circleci/elixir:1.9.1-node-browsers
# - image: circleci/elixir:1.9.4-node-browsers
# environment:
# MIX_ENV: test
# # match POSTGRES_PASSWORD for postgres image below
@ -444,7 +448,7 @@ jobs:
# test_parity_http_websocket:
# docker:
# # Ensure .tool-versions matches
# - image: circleci/elixir:1.9.1-node-browsers
# - image: circleci/elixir:1.9.4-node-browsers
# environment:
# MIX_ENV: test
# # match POSTGRES_PASSWORD for postgres image below
@ -498,7 +502,7 @@ jobs:
test_parity_mox:
docker:
# Ensure .tool-versions matches
- image: circleci/elixir:1.9.1-node-browsers
- image: circleci/elixir:1.9.4-node-browsers
environment:
MIX_ENV: test
# match POSTGRES_PASSWORD for postgres image below
@ -552,7 +556,7 @@ jobs:
coveralls_merge:
docker:
# Ensure .tool-versions matches
- image: circleci/elixir:1.9.1
- image: circleci/elixir:1.9.4
environment:
MIX_ENV: test

@ -1,3 +1,3 @@
elixir 1.9.1-otp-22
erlang 22.0
nodejs 10.11.0
elixir 1.9.4
erlang 22.2
nodejs 12.14.1

@ -4,6 +4,9 @@
### Fixes
- [#2990](https://github.com/poanetwork/blockscout/pull/2990) - Fix import of Parity spec file
- [#2989](https://github.com/poanetwork/blockscout/pull/2989) - Introduce API_PATH env var
- [#2988](https://github.com/poanetwork/blockscout/pull/2988) - Fix web manifest accessibility
- [#2950](https://github.com/poanetwork/blockscout/pull/2950) - Add `creationMethod` to `EthereumJSONRPC.Parity.Trace.Action.entry_to_elixir`
- [#2897](https://github.com/poanetwork/blockscout/pull/2897) - remove duplicate indexes
### Chore
@ -47,6 +50,7 @@
- [#2946](https://github.com/poanetwork/blockscout/pull/2946) - Fix vulnerable NPM deps
- [#2942](https://github.com/poanetwork/blockscout/pull/2942) - Actualize Docker setup
- [#2896](https://github.com/poanetwork/blockscout/pull/2896) - Disable Parity websockets tests
- [#2873](https://github.com/poanetwork/blockscout/pull/2873) - bump elixir to 1.9.4
## 2.1.1-beta

@ -44,8 +44,9 @@ function parseInput (input) {
}
}
function dropDomain (url) {
return new URL(url).pathname
function composeRequestUrl () {
const url = $('[data-endpoint-url]').attr('data-endpoint-url')
return url
}
$('button[data-try-eth-api-ui-button-type="execute"]').click(event => {
@ -64,10 +65,8 @@ $('button[data-try-eth-api-ui-button-type="execute"]').click(event => {
clickedButton.html(loadingText)
}
const url = $('[data-endpoint-url]').attr('data-endpoint-url')
$.ajax({
url: dropDomain(url),
url: composeRequestUrl(),
type: 'POST',
data: JSON.stringify(formData),
dataType: 'json',

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 762 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 405 KiB

@ -41,7 +41,8 @@ config :block_scout_web, BlockScoutWeb.Endpoint,
url: [
scheme: System.get_env("BLOCKSCOUT_PROTOCOL") || "http",
host: System.get_env("BLOCKSCOUT_HOST") || "localhost",
path: System.get_env("NETWORK_PATH") || "/"
path: System.get_env("NETWORK_PATH") || "/",
api_path: System.get_env("API_PATH") || "/"
],
render_errors: [view: BlockScoutWeb.ErrorView, accepts: ~w(html json)],
pubsub: [name: BlockScoutWeb.PubSub]

@ -21,7 +21,8 @@ config :block_scout_web, BlockScoutWeb.Endpoint,
url: [
scheme: "http",
host: System.get_env("BLOCKSCOUT_HOST") || "localhost",
path: System.get_env("NETWORK_PATH") || "/"
path: System.get_env("NETWORK_PATH") || "/",
api_path: System.get_env("API_PATH") || "/"
],
https: [
port: (port && port + 1) || 4001,

@ -23,7 +23,8 @@ config :block_scout_web, BlockScoutWeb.Endpoint,
scheme: System.get_env("BLOCKSCOUT_PROTOCOL") || "https",
port: System.get_env("PORT"),
host: System.get_env("BLOCKSCOUT_HOST") || "localhost",
path: System.get_env("NETWORK_PATH") || "/"
path: System.get_env("NETWORK_PATH") || "/",
api_path: System.get_env("API_PATH") || "/"
]
config :block_scout_web, BlockScoutWeb.Tracer, env: "production", disabled?: true

@ -29,9 +29,9 @@ defmodule BlockScoutWeb.Endpoint do
browserconfig.xml
mstile-150x150.png
safari-pinned-tab.svg
site.manifest
robots.txt
)
),
only_matching: ~w(manifest)
)
# Code reloading can be explicitly enabled under the

@ -12,7 +12,7 @@
<link rel="apple-touch-icon" sizes="180x180" href="<%= static_path(@conn, "/apple-touch-icon.png") %>">
<link rel="icon" type="image/png" sizes="32x32" href="<%= static_path(@conn, "/images/favicon-32x32.png") %>">
<link rel="icon" type="image/png" sizes="16x16" href="<%= static_path(@conn, "/images/favicon-16x16.png") %>">
<link rel="manifest" href="<%= static_path(@conn, "/site.webmanifest") %>">
<link rel="manifest" href="<%= static_path(@conn, "/manifest.webmanifest") %>">
<link rel="mask-icon" href="<%= static_path(@conn, "/safari-pinned-tab.svg") %>" color="#5bbad5">
<link rel="shortcut icon" type='image/x-icon' href="<%= static_path(@conn, "/images/favicon.ico") %>">
<meta name="msapplication-TileColor" content="#7dd79f">

@ -34,10 +34,17 @@ defmodule BlockScoutWeb.APIDocsView do
end)
end
def blockscout_url do
def blockscout_url(is_api) do
url_params = Application.get_env(:block_scout_web, BlockScoutWeb.Endpoint)[:url]
host = url_params[:host]
path = url_params[:path]
path =
if is_api do
url_params[:api_path]
else
url_params[:path]
end
scheme = Keyword.get(url_params, :scheme, "http")
if host != "localhost" do
@ -49,12 +56,18 @@ defmodule BlockScoutWeb.APIDocsView do
end
def api_url do
blockscout_url()
is_api = true
is_api
|> blockscout_url()
|> Path.join("api")
end
def eth_rpc_api_url do
blockscout_url()
is_api = true
is_api
|> blockscout_url()
|> Path.join("api/eth_rpc")
end
end

@ -4,7 +4,7 @@ defmodule BlockScoutWeb.Tokens.Instance.OverviewView do
alias BlockScoutWeb.CurrencyHelpers
alias Explorer.Chain.{Address, SmartContract, Token}
import BlockScoutWeb.APIDocsView, only: [blockscout_url: 0]
import BlockScoutWeb.APIDocsView, only: [blockscout_url: 1]
@tabs ["token_transfers", "metadata"]
@ -55,7 +55,8 @@ defmodule BlockScoutWeb.Tokens.Instance.OverviewView do
def qr_code(conn, token_id, hash) do
token_instance_path = token_instance_path(conn, :show, to_string(hash), to_string(token_id))
url = Path.join(blockscout_url(), token_instance_path)
is_api = false
url = Path.join(blockscout_url(is_api), token_instance_path)
url
|> QRCode.to_png()

@ -898,7 +898,7 @@ msgstr ""
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:4
#: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:7
#: lib/block_scout_web/views/address_view.ex:308
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:71
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:72
#: lib/block_scout_web/views/tokens/overview_view.ex:35
#: lib/block_scout_web/views/transaction_view.ex:314
msgid "Token Transfers"
@ -1774,7 +1774,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/tokens/instance/metadata/index.html.eex:18
#: lib/block_scout_web/templates/tokens/instance/overview/_tabs.html.eex:10
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:72
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:73
msgid "Metadata"
msgstr ""

@ -898,7 +898,7 @@ msgstr ""
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:4
#: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:7
#: lib/block_scout_web/views/address_view.ex:308
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:71
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:72
#: lib/block_scout_web/views/tokens/overview_view.ex:35
#: lib/block_scout_web/views/transaction_view.ex:314
msgid "Token Transfers"
@ -1774,7 +1774,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/tokens/instance/metadata/index.html.eex:18
#: lib/block_scout_web/templates/tokens/instance/overview/_tabs.html.eex:10
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:72
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:73
msgid "Metadata"
msgstr ""

@ -14,7 +14,7 @@ defmodule BlockScoutWeb.ApiDocsViewTest do
test "adds slash before path" do
Application.put_env(:block_scout_web, BlockScoutWeb.Endpoint,
url: [scheme: "https", host: "blockscout.com", port: 9999, path: "/chain/dog"]
url: [scheme: "https", host: "blockscout.com", port: 9999, api_path: "/chain/dog"]
)
assert APIDocsView.api_url() == "https://blockscout.com/chain/dog/api"
@ -22,7 +22,7 @@ defmodule BlockScoutWeb.ApiDocsViewTest do
test "does not add slash to empty path" do
Application.put_env(:block_scout_web, BlockScoutWeb.Endpoint,
url: [scheme: "https", host: "blockscout.com", port: 9999, path: ""]
url: [scheme: "https", host: "blockscout.com", port: 9999, api_path: ""]
)
assert APIDocsView.api_url() == "https://blockscout.com/api"
@ -49,7 +49,7 @@ defmodule BlockScoutWeb.ApiDocsViewTest do
test "adds slash before path" do
Application.put_env(:block_scout_web, BlockScoutWeb.Endpoint,
url: [scheme: "https", host: "blockscout.com", port: 9999, path: "/chain/dog"]
url: [scheme: "https", host: "blockscout.com", port: 9999, api_path: "/chain/dog"]
)
assert APIDocsView.eth_rpc_api_url() == "https://blockscout.com/chain/dog/api/eth_rpc"

@ -45,7 +45,7 @@ defmodule EthereumJSONRPC.Parity.Trace.Action do
end
defp entry_to_elixir({key, value} = entry)
when key in ~w(address callType from init input refundAddress to) and is_binary(value),
when key in ~w(address callType from init input refundAddress to creationMethod) and is_binary(value),
do: entry
defp entry_to_elixir({key, quantity}) when key in ~w(balance gas value) do

@ -1,4 +1,4 @@
FROM bitwalker/alpine-elixir-phoenix:1.9.1
FROM bitwalker/alpine-elixir-phoenix:1.9.4
RUN apk --no-cache --update add alpine-sdk gmp-dev automake libtool inotify-tools autoconf python

Loading…
Cancel
Save