Compiler nightly builds as an option

pull/2975/head
Victor Baranov 5 years ago
parent 904b6eae8f
commit ca9a8cf629
  1. 1
      CHANGELOG.md
  2. 40
      apps/block_scout_web/assets/js/pages/verification_form.js
  3. 32
      apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification/new.html.eex
  4. 34
      apps/block_scout_web/priv/gettext/default.pot
  5. 34
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po

@ -2,6 +2,7 @@
### Features ### Features
- [#2835](https://github.com/poanetwork/blockscout/pull/2835), [#2871](https://github.com/poanetwork/blockscout/pull/2871), [#2872](https://github.com/poanetwork/blockscout/pull/2872), [#2886](https://github.com/poanetwork/blockscout/pull/2886), [#2925](https://github.com/poanetwork/blockscout/pull/2925), [#2936](https://github.com/poanetwork/blockscout/pull/2936), [#2949](https://github.com/poanetwork/blockscout/pull/2949), [#2940](https://github.com/poanetwork/blockscout/pull/2940), [#2958](https://github.com/poanetwork/blockscout/pull/2958) - Add "block_hash" to logs, token_transfers and internal transactions and "pending blocks operations" approach - [#2835](https://github.com/poanetwork/blockscout/pull/2835), [#2871](https://github.com/poanetwork/blockscout/pull/2871), [#2872](https://github.com/poanetwork/blockscout/pull/2872), [#2886](https://github.com/poanetwork/blockscout/pull/2886), [#2925](https://github.com/poanetwork/blockscout/pull/2925), [#2936](https://github.com/poanetwork/blockscout/pull/2936), [#2949](https://github.com/poanetwork/blockscout/pull/2949), [#2940](https://github.com/poanetwork/blockscout/pull/2940), [#2958](https://github.com/poanetwork/blockscout/pull/2958) - Add "block_hash" to logs, token_transfers and internal transactions and "pending blocks operations" approach
- [#2975](https://github.com/poanetwork/blockscout/pull/2975) - Refine UX of contracts verification
- [#2926](https://github.com/poanetwork/blockscout/pull/2926) - API endpoint: sum balances except burnt address - [#2926](https://github.com/poanetwork/blockscout/pull/2926) - API endpoint: sum balances except burnt address
- [#2918](https://github.com/poanetwork/blockscout/pull/2918) - Add tokenID for tokentx API action explicitly - [#2918](https://github.com/poanetwork/blockscout/pull/2918) - Add tokenID for tokentx API action explicitly

@ -88,6 +88,26 @@ const elements = {
const $contractVerificationPage = $('[data-page="contract-verification"]') const $contractVerificationPage = $('[data-page="contract-verification"]')
function filterNightlyBuilds (filter) {
var select, options
select = document.getElementById('smart_contract_compiler_version')
options = select.getElementsByTagName('option')
for (const option of options) {
var txtValue = option.textContent || option.innerText
if (filter) {
if (txtValue.toLowerCase().indexOf('nightly') > -1) {
option.style.display = 'none'
} else {
option.style.display = ''
}
} else {
if (txtValue.toLowerCase().indexOf('nightly') > -1) {
option.style.display = ''
}
}
}
}
if ($contractVerificationPage.length) { if ($contractVerificationPage.length) {
const store = createStore(reducer) const store = createStore(reducer)
const addressHash = $('#smart_contract_address_hash').val() const addressHash = $('#smart_contract_address_hash').val()
@ -116,6 +136,10 @@ if ($contractVerificationPage.length) {
}) })
$(function () { $(function () {
setTimeout(function () {
$('.nightly-builds-false').trigger('click')
}, 10)
$('.js-btn-add-contract-libraries').on('click', function () { $('.js-btn-add-contract-libraries').on('click', function () {
$('.js-smart-contract-libraries-wrapper').show() $('.js-smart-contract-libraries-wrapper').show()
$(this).hide() $(this).hide()
@ -129,6 +153,22 @@ if ($contractVerificationPage.length) {
if ($(this).prop('checked')) { $('.constructor-arguments').hide() } if ($(this).prop('checked')) { $('.constructor-arguments').hide() }
}) })
$('.nightly-builds-true').on('click', function () {
if ($(this).prop('checked')) { filterNightlyBuilds(false) }
})
$('.nightly-builds-false').on('click', function () {
if ($(this).prop('checked')) { filterNightlyBuilds(true) }
})
$('.optimization-false').on('click', function () {
if ($(this).prop('checked')) { $('.optimization-runs').hide() }
})
$('.optimization-true').on('click', function () {
if ($(this).prop('checked')) { $('.optimization-runs').show() }
})
$('.js-smart-contract-form-reset').on('click', function () { $('.js-smart-contract-form-reset').on('click', function () {
$('.js-contract-library-form-group').removeClass('active') $('.js-contract-library-form-group').removeClass('active')
$('.js-contract-library-form-group').first().addClass('active') $('.js-contract-library-form-group').first().addClass('active')

@ -35,6 +35,28 @@
</div> </div>
</div> </div>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label f, "Include nightly builds" %>
<div class="center-column">
<div class="form-radios-group">
<div class="radio-big">
<%= radio_button f, :nightly_builds, false, checked: true, class: "form-check-input nightly-builds-false" %>
<div class="radio-icon"></div>
<%= label :nightly_builds, :false, gettext("No"), class: "radio-text" %>
</div>
<div class="radio-big">
<%= radio_button f, :nightly_builds, true, class: "form-check-input nightly-builds-true", "aria-describedby": "nightly_builds-help-block" %>
<div class="radio-icon"></div>
<%= label :nightly_builds, :true, gettext("Yes"), class: "radio-text" %>
</div>
</div>
<%= error_tag f, :nightly_builds, id: "nightly_builds-help-block", class: "text-danger form-error" %>
</div>
<div class="smart-contract-form-group-tooltip">Select yes if you want to show nightly builds.</div>
</div>
</div>
<div class="smart-contract-form-group"> <div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper"> <div class="smart-contract-form-group-inner-wrapper">
<%= label f, :compiler_version, gettext("Compiler") %> <%= label f, :compiler_version, gettext("Compiler") %>
@ -62,12 +84,12 @@
<div class="center-column"> <div class="center-column">
<div class="form-radios-group"> <div class="form-radios-group">
<div class="radio-big"> <div class="radio-big">
<%= radio_button f, :optimization, false, checked: true, class: "form-check-input" %> <%= radio_button f, :optimization, false, class: "form-check-input optimization-false" %>
<div class="radio-icon"></div> <div class="radio-icon"></div>
<%= label :smart_contract_optimization, :false, gettext("No"), class: "radio-text" %> <%= label :smart_contract_optimization, :false, gettext("No"), class: "radio-text" %>
</div> </div>
<div class="radio-big"> <div class="radio-big">
<%= radio_button f, :optimization, true, class: "form-check-input", "aria-describedby": "optimization-help-block" %> <%= radio_button f, :optimization, true, checked: true, class: "form-check-input optimization-true", "aria-describedby": "optimization-help-block" %>
<div class="radio-icon"></div> <div class="radio-icon"></div>
<%= label :smart_contract_optimization, :true, gettext("Yes"), class: "radio-text" %> <%= label :smart_contract_optimization, :true, gettext("Yes"), class: "radio-text" %>
</div> </div>
@ -78,7 +100,7 @@
</div> </div>
</div> </div>
<div class="smart-contract-form-group"> <div class="smart-contract-form-group optimization-runs">
<div class="smart-contract-form-group-inner-wrapper"> <div class="smart-contract-form-group-inner-wrapper">
<%= label f, :name, gettext("Optimization runs") %> <%= label f, :name, gettext("Optimization runs") %>
<div class="center-column"> <div class="center-column">
@ -110,12 +132,12 @@
<%= label :autodetect_contructor_args, :false, gettext("No"), class: "radio-text" %> <%= label :autodetect_contructor_args, :false, gettext("No"), class: "radio-text" %>
</div> </div>
<div class="radio-big"> <div class="radio-big">
<%= radio_button f, :autodetect_contructor_args, true, class: "form-check-input autodetecttrue", "aria-describedby": "optimization-help-block" %> <%= radio_button f, :autodetect_contructor_args, true, class: "form-check-input autodetecttrue", "aria-describedby": "autodetect_contructor_args-help-block" %>
<div class="radio-icon"></div> <div class="radio-icon"></div>
<%= label :autodetect_contructor_args, :true, gettext("Yes"), class: "radio-text" %> <%= label :autodetect_contructor_args, :true, gettext("Yes"), class: "radio-text" %>
</div> </div>
</div> </div>
<%= error_tag f, :autodetect_contructor_args, id: "optimization-help-block", class: "text-danger form-error" %> <%= error_tag f, :autodetect_contructor_args, id: "autodetect_contructor_args-help-block", class: "text-danger form-error" %>
</div> </div>
</div> </div>
</div> </div>

@ -87,7 +87,7 @@ msgid "A string with the name of the module to be invoked."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:125 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:147
msgid "ABI-encoded Constructor Arguments (if required by the contract)" msgid "ABI-encoded Constructor Arguments (if required by the contract)"
msgstr "" msgstr ""
@ -266,7 +266,7 @@ msgid "Call Code"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:274 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:296
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:47 #: 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 #: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:54
msgid "Cancel" msgid "Cancel"
@ -289,7 +289,7 @@ msgid "Clear"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:40 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:62
msgid "Compiler" msgid "Compiler"
msgstr "" msgstr ""
@ -370,7 +370,7 @@ msgid "Contract Creation Code"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:139 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:161
msgid "Contract Libraries" msgid "Contract Libraries"
msgstr "" msgstr ""
@ -579,7 +579,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract/index.html.eex:45 #: lib/block_scout_web/templates/address_contract/index.html.eex:45
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:51 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:73
msgid "EVM Version" msgid "EVM Version"
msgstr "" msgstr ""
@ -599,7 +599,7 @@ msgid "Emission Reward"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:93 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:115
msgid "Enter the Solidity Contract Code" msgid "Enter the Solidity Contract Code"
msgstr "" msgstr ""
@ -971,20 +971,20 @@ msgid "Less than"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:154
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:176 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:176
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:198 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:198
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:220 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:220
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:242 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:242
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:264
msgid "Library Address" msgid "Library Address"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:144
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:166 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:166
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:188 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:188
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:210 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:210
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:232 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:232
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:254
msgid "Library Name" msgid "Library Name"
msgstr "" msgstr ""
@ -1010,7 +1010,7 @@ msgid "Loading..."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:268 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:290
msgid "Loading...." msgid "Loading...."
msgstr "" msgstr ""
@ -1096,8 +1096,9 @@ msgid "New Smart Contract Verification"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:67 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:46
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:110 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:89
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:132
msgid "No" msgid "No"
msgstr "" msgstr ""
@ -1114,7 +1115,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract/index.html.eex:39 #: lib/block_scout_web/templates/address_contract/index.html.eex:39
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:83 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:105
msgid "Optimization runs" msgid "Optimization runs"
msgstr "" msgstr ""
@ -1218,7 +1219,7 @@ msgid "Request URL"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:271 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:293
msgid "Reset" msgid "Reset"
msgstr "" msgstr ""
@ -1580,7 +1581,7 @@ msgid "Verify & Publish"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:270 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:292
msgid "Verify & publish" msgid "Verify & publish"
msgstr "" msgstr ""
@ -1654,8 +1655,9 @@ msgid "Wei"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:72 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:51
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:115 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:94
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:137
msgid "Yes" msgid "Yes"
msgstr "" msgstr ""

@ -87,7 +87,7 @@ msgid "A string with the name of the module to be invoked."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:125 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:147
msgid "ABI-encoded Constructor Arguments (if required by the contract)" msgid "ABI-encoded Constructor Arguments (if required by the contract)"
msgstr "" msgstr ""
@ -266,7 +266,7 @@ msgid "Call Code"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:274 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:296
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:47 #: 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 #: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:54
msgid "Cancel" msgid "Cancel"
@ -289,7 +289,7 @@ msgid "Clear"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:40 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:62
msgid "Compiler" msgid "Compiler"
msgstr "" msgstr ""
@ -370,7 +370,7 @@ msgid "Contract Creation Code"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:139 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:161
msgid "Contract Libraries" msgid "Contract Libraries"
msgstr "" msgstr ""
@ -579,7 +579,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract/index.html.eex:45 #: lib/block_scout_web/templates/address_contract/index.html.eex:45
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:51 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:73
msgid "EVM Version" msgid "EVM Version"
msgstr "" msgstr ""
@ -599,7 +599,7 @@ msgid "Emission Reward"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:93 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:115
msgid "Enter the Solidity Contract Code" msgid "Enter the Solidity Contract Code"
msgstr "" msgstr ""
@ -971,20 +971,20 @@ msgid "Less than"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:154
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:176 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:176
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:198 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:198
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:220 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:220
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:242 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:242
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:264
msgid "Library Address" msgid "Library Address"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:144
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:166 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:166
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:188 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:188
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:210 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:210
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:232 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:232
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:254
msgid "Library Name" msgid "Library Name"
msgstr "" msgstr ""
@ -1010,7 +1010,7 @@ msgid "Loading..."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:268 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:290
msgid "Loading...." msgid "Loading...."
msgstr "" msgstr ""
@ -1096,8 +1096,9 @@ msgid "New Smart Contract Verification"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:67 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:46
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:110 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:89
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:132
msgid "No" msgid "No"
msgstr "" msgstr ""
@ -1114,7 +1115,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract/index.html.eex:39 #: lib/block_scout_web/templates/address_contract/index.html.eex:39
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:83 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:105
msgid "Optimization runs" msgid "Optimization runs"
msgstr "" msgstr ""
@ -1218,7 +1219,7 @@ msgid "Request URL"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:271 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:293
msgid "Reset" msgid "Reset"
msgstr "" msgstr ""
@ -1580,7 +1581,7 @@ msgid "Verify & Publish"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:270 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:292
msgid "Verify & publish" msgid "Verify & publish"
msgstr "" msgstr ""
@ -1654,8 +1655,9 @@ msgid "Wei"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:72 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:51
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:115 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:94
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:137
msgid "Yes" msgid "Yes"
msgstr "" msgstr ""

Loading…
Cancel
Save