This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Allow setting of minBlock on sending #3921
Merged
+459
−183
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b6826ea
minBlock value formatting
jacogr 2a64f7f
Allow Contract execute to specify minBock
jacogr 2025ca7
Transfer allows minBlock
jacogr 48b545a
Cleanups
jacogr a325320
Check errors, verify via testing
jacogr f4b7450
Merge branch 'master' into jg-minBlock
jacogr 483726b
Merge branch 'master' into jg-minBlock
jacogr 1083483
Display Submitted/Submission block in MethodDecoding
jacogr 58d9047
Merge branch 'master' into jg-minBlock
jacogr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Allow Contract execute to specify minBock
- Loading branch information
commit 2a64f7f49dfcc19f5ff26f2df51e687c3156fb05
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
js/src/modals/ExecuteContract/AdvancedStep/advancedStep.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright 2015, 2016 Parity Technologies (UK) Ltd. | ||
// This file is part of Parity. | ||
|
||
// Parity is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Parity is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Parity. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import React, { Component, PropTypes } from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { Input, GasPriceEditor } from '~/ui'; | ||
|
||
import styles from '../executeContract.css'; | ||
|
||
export default class AdvancedStep extends Component { | ||
static propTypes = { | ||
gasStore: PropTypes.object.isRequired, | ||
minBlock: PropTypes.string, | ||
minBlockError: PropTypes.string, | ||
onMinBlockChange: PropTypes.func | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [minor grumble] Any reason not to make this |
||
}; | ||
|
||
render () { | ||
const { gasStore, minBlock, minBlockError, onMinBlockChange } = this.props; | ||
|
||
return ( | ||
<div> | ||
<Input | ||
error={ minBlockError } | ||
hint={ | ||
<FormattedMessage | ||
id='executeContract.advanced.minBlock.hint' | ||
defaultMessage='Only post the transaction after this block' /> | ||
} | ||
label={ | ||
<FormattedMessage | ||
id='executeContract.advanced.minBlock.label' | ||
defaultMessage='BlockNumber to send from' /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This indicates that the tx will definitely get mined at the specific block. I'd propose something that is better aligned with the hint above. |
||
} | ||
value={ minBlock } | ||
onSubmit={ onMinBlockChange } /> | ||
<div className={ styles.gaseditor }> | ||
<GasPriceEditor store={ gasStore } /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2015, 2016 Parity Technologies (UK) Ltd. | ||
// This file is part of Parity. | ||
|
||
// Parity is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Parity is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Parity. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
export default from './advancedStep'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,9 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Parity. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import React, { Component, PropTypes } from 'react'; | ||
import { Checkbox, MenuItem } from 'material-ui'; | ||
import React, { Component, PropTypes } from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { AddressSelect, Form, Input, Select, TypedInput } from '~/ui'; | ||
|
||
|
@@ -29,29 +30,28 @@ const CHECK_STYLE = { | |
|
||
export default class DetailsStep extends Component { | ||
static propTypes = { | ||
advancedOptions: PropTypes.bool, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [tiny grumble] Would prefer something that indicates that this is a boolean, e.g. |
||
accounts: PropTypes.object.isRequired, | ||
contract: PropTypes.object.isRequired, | ||
onAmountChange: PropTypes.func.isRequired, | ||
onFromAddressChange: PropTypes.func.isRequired, | ||
onValueChange: PropTypes.func.isRequired, | ||
values: PropTypes.array.isRequired, | ||
valuesError: PropTypes.array.isRequired, | ||
|
||
amount: PropTypes.string, | ||
amountError: PropTypes.string, | ||
balances: PropTypes.object, | ||
contract: PropTypes.object.isRequired, | ||
fromAddress: PropTypes.string, | ||
fromAddressError: PropTypes.string, | ||
func: PropTypes.object, | ||
funcError: PropTypes.string, | ||
gasEdit: PropTypes.bool, | ||
onAdvancedClick: PropTypes.func, | ||
onAmountChange: PropTypes.func.isRequired, | ||
onFromAddressChange: PropTypes.func.isRequired, | ||
onFuncChange: PropTypes.func, | ||
onGasEditClick: PropTypes.func, | ||
onValueChange: PropTypes.func.isRequired, | ||
values: PropTypes.array.isRequired, | ||
valuesError: PropTypes.array.isRequired, | ||
warning: PropTypes.string | ||
} | ||
|
||
render () { | ||
const { accounts, amount, amountError, balances, fromAddress, fromAddressError, gasEdit, onGasEditClick, onFromAddressChange, onAmountChange } = this.props; | ||
const { accounts, advancedOptions, amount, amountError, balances, fromAddress, fromAddressError, onAdvancedClick, onAmountChange, onFromAddressChange } = this.props; | ||
|
||
return ( | ||
<Form> | ||
|
@@ -60,8 +60,16 @@ export default class DetailsStep extends Component { | |
accounts={ accounts } | ||
balances={ balances } | ||
error={ fromAddressError } | ||
hint='the account to transact with' | ||
label='from account' | ||
hint={ | ||
<FormattedMessage | ||
id='executeContract.details.address.label' | ||
defaultMessage='the account to transact with' /> | ||
} | ||
label={ | ||
<FormattedMessage | ||
id='executeContract.details.address.hint' | ||
defaultMessage='from account' /> | ||
} | ||
onChange={ onFromAddressChange } | ||
value={ fromAddress } /> | ||
{ this.renderFunctionSelect() } | ||
|
@@ -70,16 +78,28 @@ export default class DetailsStep extends Component { | |
<div> | ||
<Input | ||
error={ amountError } | ||
hint='the amount to send to with the transaction' | ||
label='transaction value (in ETH)' | ||
hint={ | ||
<FormattedMessage | ||
id='executeContract.details.amount.hint' | ||
defaultMessage='the amount to send to with the transaction' /> | ||
} | ||
label={ | ||
<FormattedMessage | ||
id='executeContract.details.amount.label' | ||
defaultMessage='transaction value (in ETH)' /> | ||
} | ||
onSubmit={ onAmountChange } | ||
value={ amount } /> | ||
</div> | ||
<div> | ||
<Checkbox | ||
checked={ gasEdit } | ||
label='edit gas price or value' | ||
onCheck={ onGasEditClick } | ||
checked={ advancedOptions } | ||
label={ | ||
<FormattedMessage | ||
id='executeContract.details.advancedCheck.label' | ||
defaultMessage='advanced sending options' /> | ||
} | ||
onCheck={ onAdvancedClick } | ||
style={ CHECK_STYLE } /> | ||
</div> | ||
</div> | ||
|
@@ -129,9 +149,17 @@ export default class DetailsStep extends Component { | |
|
||
return ( | ||
<Select | ||
label='function to execute' | ||
hint='the function to call on the contract' | ||
error={ funcError } | ||
hint={ | ||
<FormattedMessage | ||
id='executeContract.details.function.hint' | ||
defaultMessage='the function to call on the contract' /> | ||
} | ||
label={ | ||
<FormattedMessage | ||
id='executeContract.details.function.label' | ||
defaultMessage='function to execute' /> | ||
} | ||
onChange={ this.onFuncChange } | ||
value={ func.signature }> | ||
{ functions } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[minor grumble] As the block number is an integer, why not use
parseInt
and make this aPropTypes.number
?