Allow custom optimizations runs for contract verifications via API

pull/4853/head
Viktor Baranov 3 years ago
parent 6e550d7ac9
commit 3cb935e5ed
  1. 1
      CHANGELOG.md
  2. 8
      apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/contract_controller.ex

@ -24,6 +24,7 @@
- [#4579](https://github.com/blockscout/blockscout/pull/4579) - Write contract page: Resize inputs; Improve multiplier selector
### Fixes
- [#4853](https://github.com/blockscout/blockscout/pull/4853) - Allow custom optimizations runs for contract verifications via API
- [#4840](https://github.com/blockscout/blockscout/pull/4840) - Replace Enum.dedup with Enum.uniq where actually uniq items are expected
- [#4835](https://github.com/blockscout/blockscout/pull/4835) - Fix view for broken token icons
- [#4830](https://github.com/blockscout/blockscout/pull/4830) - Speed up txs per day chart data collection

@ -461,7 +461,13 @@ defmodule BlockScoutWeb.API.RPC.ContractController do
end
defp parse_optimization_runs({:ok, %{"optimization_runs" => runs} = opts}) when is_bitstring(runs) do
{:ok, Map.put(opts, "optimization_runs", 200)}
case Integer.parse(runs) do
{runs_int, _} ->
{:ok, Map.put(opts, "optimization_runs", runs_int)}
_ ->
{:ok, Map.put(opts, "optimization_runs", 200)}
end
end
defp parse_optimization_runs({:ok, %{"optimization_runs" => runs} = opts}) when is_integer(runs) do

Loading…
Cancel
Save