Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Allow setting of minBlock on sending #3921

Merged
merged 9 commits into from
Dec 23, 2016
Merged

Allow setting of minBlock on sending #3921

merged 9 commits into from
Dec 23, 2016

Conversation

jacogr
Copy link
Contributor

@jacogr jacogr commented Dec 20, 2016

@jacogr jacogr added A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. M7-ui labels Dec 20, 2016
@jacogr jacogr added A0-pleasereview 🤓 Pull request needs code review. and removed A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. labels Dec 20, 2016
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling f4b7450 on jg-minBlock into ** on master**.

@gavofyork gavofyork modified the milestone: 1.5 Tenuity Dec 20, 2016
@coveralls
Copy link

Coverage Status

Coverage remained the same at 85.813% when pulling 483726b on jg-minBlock into b369939 on master.

label={
<FormattedMessage
id='executeContract.advanced.minBlock.label'
defaultMessage='BlockNumber to send from' />
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

@derhuerst
Copy link
Contributor

As a comment: #3594 sounds a lot like it has been designed this way, but I'd prefer the minBlock setting to be in the signer.

I like the idea of the first stage (e.g. transfer, contract execution) is about what to do, whereas the second stage (signer) is about how to do it.

export default class AdvancedStep extends Component {
static propTypes = {
gasStore: PropTypes.object.isRequired,
minBlock: PropTypes.string,
Copy link
Contributor

@derhuerst derhuerst Dec 21, 2016

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 a PropTypes.number?

gasStore: PropTypes.object.isRequired,
minBlock: PropTypes.string,
minBlockError: PropTypes.string,
onMinBlockChange: PropTypes.func
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor grumble] Any reason not to make this isRequired?

@@ -29,29 +30,28 @@ const CHECK_STYLE = {

export default class DetailsStep extends Component {
static propTypes = {
advancedOptions: PropTypes.bool,
Copy link
Contributor

Choose a reason for hiding this comment

The 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. showAdvancedOptions.

sending: false,
step: finalstep,
txhash,
busyState:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to keep plain strings in the state and use FormattedMessage when rendering.

})
.catch((error) => {
console.error('postTransaction', error);
store.dispatch({ type: 'newError', error });
});
}

onGasEditClick = () => {
onAdvancedClick = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[tiny grumble] If this was called toggleAdvancedOptions, it would resemble the advancedOptions flag which it toggles. Also, onCheck={ toggleAdvancedOptions } is more readable.

@derhuerst derhuerst added A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging. and removed A0-pleasereview 🤓 Pull request needs code review. labels Dec 21, 2016
@gavofyork
Copy link
Contributor

gavofyork commented Dec 22, 2016

I'd prefer the minBlock setting to be in the signer.

Signer should indeed be able to tweak it for maximum flexibility, but there's good reason to allow the dapp to request minBlock when making their transactions, too. This is just about ensuring that the user is informed about what's going on (if it's not the default).

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 58d9047 on jg-minBlock into ** on master**.

@jacogr jacogr merged commit fc620d0 into master Dec 23, 2016
@jacogr jacogr deleted the jg-minBlock branch December 23, 2016 14:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants