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
- [#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
- [#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"]')
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) {
const store = createStore(reducer)
const addressHash = $('#smart_contract_address_hash').val()
@ -116,6 +136,10 @@ if ($contractVerificationPage.length) {
})
$(function () {
setTimeout(function () {
$('.nightly-builds-false').trigger('click')
}, 10)
$('.js-btn-add-contract-libraries').on('click', function () {
$('.js-smart-contract-libraries-wrapper').show()
$(this).hide()
@ -129,6 +153,22 @@ if ($contractVerificationPage.length) {
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-contract-library-form-group').removeClass('active')
$('.js-contract-library-form-group').first().addClass('active')

@ -35,6 +35,28 @@
</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-inner-wrapper">
<%= label f, :compiler_version, gettext("Compiler") %>
@ -62,12 +84,12 @@
<div class="center-column">
<div class="form-radios-group">
<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>
<%= label :smart_contract_optimization, :false, gettext("No"), class: "radio-text" %>
</div>
<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>
<%= label :smart_contract_optimization, :true, gettext("Yes"), class: "radio-text" %>
</div>
@ -78,7 +100,7 @@
</div>
</div>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group optimization-runs">
<div class="smart-contract-form-group-inner-wrapper">
<%= label f, :name, gettext("Optimization runs") %>
<div class="center-column">
@ -110,12 +132,12 @@
<%= label :autodetect_contructor_args, :false, gettext("No"), class: "radio-text" %>
</div>
<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>
<%= label :autodetect_contructor_args, :true, gettext("Yes"), class: "radio-text" %>
</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>

@ -87,7 +87,7 @@ msgid "A string with the name of the module to be invoked."
msgstr ""
#, 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)"
msgstr ""
@ -266,7 +266,7 @@ msgid "Call Code"
msgstr ""
#, 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/_eth_rpc_item.html.eex:54
msgid "Cancel"
@ -289,7 +289,7 @@ msgid "Clear"
msgstr ""
#, 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"
msgstr ""
@ -370,7 +370,7 @@ msgid "Contract Creation Code"
msgstr ""
#, 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"
msgstr ""
@ -579,7 +579,7 @@ msgstr ""
#, elixir-format
#: 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"
msgstr ""
@ -599,7 +599,7 @@ msgid "Emission Reward"
msgstr ""
#, 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"
msgstr ""
@ -971,20 +971,20 @@ msgid "Less than"
msgstr ""
#, 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:198
#: 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:264
msgid "Library Address"
msgstr ""
#, 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:188
#: 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:254
msgid "Library Name"
msgstr ""
@ -1010,7 +1010,7 @@ msgid "Loading..."
msgstr ""
#, 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...."
msgstr ""
@ -1096,8 +1096,9 @@ msgid "New Smart Contract Verification"
msgstr ""
#, 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:110
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:46
#: 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"
msgstr ""
@ -1114,7 +1115,7 @@ msgstr ""
#, elixir-format
#: 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"
msgstr ""
@ -1218,7 +1219,7 @@ msgid "Request URL"
msgstr ""
#, 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"
msgstr ""
@ -1580,7 +1581,7 @@ msgid "Verify & Publish"
msgstr ""
#, 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"
msgstr ""
@ -1654,8 +1655,9 @@ msgid "Wei"
msgstr ""
#, 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:115
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:51
#: 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"
msgstr ""

@ -87,7 +87,7 @@ msgid "A string with the name of the module to be invoked."
msgstr ""
#, 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)"
msgstr ""
@ -266,7 +266,7 @@ msgid "Call Code"
msgstr ""
#, 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/_eth_rpc_item.html.eex:54
msgid "Cancel"
@ -289,7 +289,7 @@ msgid "Clear"
msgstr ""
#, 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"
msgstr ""
@ -370,7 +370,7 @@ msgid "Contract Creation Code"
msgstr ""
#, 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"
msgstr ""
@ -579,7 +579,7 @@ msgstr ""
#, elixir-format
#: 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"
msgstr ""
@ -599,7 +599,7 @@ msgid "Emission Reward"
msgstr ""
#, 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"
msgstr ""
@ -971,20 +971,20 @@ msgid "Less than"
msgstr ""
#, 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:198
#: 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:264
msgid "Library Address"
msgstr ""
#, 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:188
#: 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:254
msgid "Library Name"
msgstr ""
@ -1010,7 +1010,7 @@ msgid "Loading..."
msgstr ""
#, 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...."
msgstr ""
@ -1096,8 +1096,9 @@ msgid "New Smart Contract Verification"
msgstr ""
#, 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:110
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:46
#: 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"
msgstr ""
@ -1114,7 +1115,7 @@ msgstr ""
#, elixir-format
#: 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"
msgstr ""
@ -1218,7 +1219,7 @@ msgid "Request URL"
msgstr ""
#, 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"
msgstr ""
@ -1580,7 +1581,7 @@ msgid "Verify & Publish"
msgstr ""
#, 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"
msgstr ""
@ -1654,8 +1655,9 @@ msgid "Wei"
msgstr ""
#, 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:115
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:51
#: 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"
msgstr ""

Loading…
Cancel
Save