fix path issue

pull/2264/head
Ayrat Badykov 5 years ago
parent 33ede5f8f2
commit 5ce569880a
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 2
      apps/block_scout_web/lib/block_scout_web/controllers/address_contract_verification_controller.ex
  2. 5
      apps/block_scout_web/lib/block_scout_web/notifier.ex
  3. 4
      apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification/new.html.eex
  4. 4
      apps/explorer/lib/explorer/smart_contract/publisher_worker.ex

@ -28,7 +28,7 @@ defmodule BlockScoutWeb.AddressContractVerificationController do
"external_libraries" => external_libraries "external_libraries" => external_libraries
} }
) do ) do
Que.add(PublisherWorker, {smart_contract["address_hash"], smart_contract, external_libraries}) Que.add(PublisherWorker, {smart_contract["address_hash"], smart_contract, external_libraries, conn})
send_resp(conn, 204, "") send_resp(conn, 204, "")
end end

@ -26,7 +26,7 @@ defmodule BlockScoutWeb.Notifier do
end end
def handle_event( def handle_event(
{:chain_event, :contract_verification_result, :on_demand, {address_hash, contract_verification_result}} {:chain_event, :contract_verification_result, :on_demand, {address_hash, contract_verification_result, conn}}
) do ) do
contract_verification_result = contract_verification_result =
case contract_verification_result do case contract_verification_result do
@ -41,7 +41,8 @@ defmodule BlockScoutWeb.Notifier do
changeset: changeset, changeset: changeset,
compiler_versions: compiler_versions, compiler_versions: compiler_versions,
evm_versions: CodeCompiler.allowed_evm_versions(), evm_versions: CodeCompiler.allowed_evm_versions(),
address_hash: address_hash address_hash: address_hash,
conn: conn
) )
{:error, result} {:error, result}

@ -9,7 +9,7 @@
<h1 class="smart-contract-title"><%= gettext "New Smart Contract Verification" %></h1> <h1 class="smart-contract-title"><%= gettext "New Smart Contract Verification" %></h1>
<%= form_for @changeset, <%= form_for @changeset,
"/verify_smart_contract/contract_verifications", address_contract_verification_path(@conn, :create),
[], [],
fn f -> %> fn f -> %>
@ -252,7 +252,7 @@
link( link(
gettext("Cancel"), gettext("Cancel"),
class: "btn-no-border", class: "btn-no-border",
to: "/address/#{@address_hash}/contracts" to: address_contract_path(@conn, :index, @address_hash)
) )
%> %>
</div> </div>

@ -8,7 +8,7 @@ defmodule Explorer.SmartContract.PublisherWorker do
alias Explorer.Chain.Events.Publisher, as: EventsPublisher alias Explorer.Chain.Events.Publisher, as: EventsPublisher
alias Explorer.SmartContract.Publisher alias Explorer.SmartContract.Publisher
def perform({address_hash, params, external_libraries}) do def perform({address_hash, params, external_libraries, conn}) do
result = result =
case Publisher.publish(address_hash, params, external_libraries) do case Publisher.publish(address_hash, params, external_libraries) do
{:ok, _contract} = result -> {:ok, _contract} = result ->
@ -18,6 +18,6 @@ defmodule Explorer.SmartContract.PublisherWorker do
{:error, changeset} {:error, changeset}
end end
EventsPublisher.broadcast([{:contract_verification_result, {address_hash, result}}], :on_demand) EventsPublisher.broadcast([{:contract_verification_result, {address_hash, result, conn}}], :on_demand)
end end
end end

Loading…
Cancel
Save