Merge pull request #4591 from blockscout/np-add-step-and-min-args

Add step and min value for txValue input
pull/4520/head
Victor Baranov 3 years ago committed by GitHub
commit a1271551b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 5
      apps/block_scout_web/assets/js/lib/smart_contract/write.js
  3. 2
      apps/block_scout_web/lib/block_scout_web/templates/smart_contract/_functions.html.eex

@ -4,6 +4,7 @@
- [#4579](https://github.com/blockscout/blockscout/pull/4579) - Write contract page: Resize inputs; Improve multiplier selector
### Fixes
- [#4591](https://github.com/blockscout/blockscout/pull/4591) - Add step and min value for txValue input field
- [#4586](https://github.com/blockscout/blockscout/pull/4586) - Fix floating tooltips on the token transfer family blocks
- [#4587](https://github.com/blockscout/blockscout/pull/4587) - Enable navbar menu on Search results page
- [#4582](https://github.com/blockscout/blockscout/pull/4582) - Fix NaN input on write contract page

@ -150,6 +150,9 @@ function getTxValue ($functionInputs) {
const WEI_MULTIPLIER = 10 ** 18
const $txValue = $functionInputs.filter('[tx-value]:first')
const txValue = $txValue && $txValue.val() && parseFloat($txValue.val()) * WEI_MULTIPLIER
const txValueStr = txValue && txValue.toString(16)
var txValueStr = txValue && txValue.toString(16)
if (!txValueStr) {
txValueStr = '0'
}
return '0x' + txValueStr
}

@ -87,7 +87,7 @@
<%= if Helper.payable?(function) do %>
<div class="form-group pr-3">
<input type="number" name="function_input" tx-value
data-toggle="tooltip" title='Amount in native token <<%= gettext("ETH")%>>' class="form-control form-control-sm address-input-sm mt-2" placeholder='value(<%= gettext("ETH")%>)' />
data-toggle="tooltip" title='Amount in native token <<%= gettext("ETH")%>>' class="form-control form-control-sm address-input-sm mt-2" placeholder='value(<%= gettext("ETH")%>)' min="0" step="1e-18" />
</div>
<% end %>

Loading…
Cancel
Save