Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ethereum Alarm Clock Integration #1343

Merged
merged 60 commits into from
Apr 14, 2018

Conversation

e00dan
Copy link
Contributor

@e00dan e00dan commented Mar 19, 2018

Description

Integrate with Ethereum Alarm Clock to provide a way to schedule transaction.

Changes

  • Add scheduling to main tab

Steps to Test

  1. Go to Send Ether & Tokens
  2. Toggle 'Send Later'
  3. Fill required fields
  4. Press 'Schedule transaction'
  5. Sign it

Screenshots

mycryptobuilds com_b0907c36d0d5f11d2ddf621c4f1fb9811e631877_

@e00dan e00dan force-pushed the feature/eac-integration branch 3 times, most recently from 5eb33da to 42b6b91 Compare March 29, 2018 17:11
@tayvano
Copy link
Contributor

tayvano commented Apr 5, 2018

UI Improvements (Ideas - To be discussed further)

  • Change the word "Scheduled" next to the toggle to "Send Later"

  • Change "Time" and "Block" radio buttons to read "Minutes" and "Blocks". Remove (min) from label above.

  • Change placeholder text in Window field so that it's 100% readable. Perhaps use an example?

  • Default to a 10 minute time period

  • Add copy underneath "Scheduled Transaction Settings": "This allows you to schedule a transaction for sending at a later time. Due to unforeseen circumstances (like the state of the network), we cannot 100% guarantee that your transaction is sent in the time period you specify." We will add a link to a knowledge base article when that article is ready.

  • Add explanations and warnings for Window, Time Bounty, and Require Deposit that explain what they are and potential downsides if they do something wrong in hover-overs. Provide recommendations on what the user should choose.

  • Gas Price / Gas Limit should match existing UI to stay consistent.

    • (Will O): As for gas UI, that might be difficult for a few reasons. One is estimation doesn’t work for the future, and the other problem is that all of our reusable components are built to modify the current transaction. It’ll be a heavy amount of code modification to get the slider working for scheduled transactions. I think we could punt on that to get this working without further expanding the scope of this already large PR.
  • Move "Powered by ChonoLogic" to the right side of the box. Reduce size by ~30%

e00dan and others added 25 commits April 6, 2018 15:55
* Scheduling: Basic date and time widget

* Linting fixes

* Moved the datetime field to new tab

* Fixed push errors

* Added missing specs

* Undid unintentional UI change

* Fixed some failing tests

* Ignore datetime parameter when checking if a transaction is full

* Added a date selector widget and renamed ScheduleTimestamp to ScheduleDate

* Marked componentDidMount

* Initialized Pikaday

* Revert "Initialized Pikaday"

This reverts commit 4e5bf5b.

* Revert "Marked componentDidMount"

This reverts commit 85d5219.

* Revert "Added a date selector widget and renamed ScheduleTimestamp to ScheduleDate"

This reverts commit aaad0ac.

* Converted the date picker into a datetime picker

* Added decent styling to the datetimepicker

* Added validation to the datetime picker

* Fixed prepush errors for scheduling timestamp

* Adjusted validation logic scheduling timestamp
* [FEATURE] Scheduling: Timezone selector

* Removed zombie files
* Implemented time/block switcher fuctionality
* Reordered, renamed and centered scheduling elements

* Added the toggle button styling

* Class -> ClassName
value: gasLimit
};

const scheduling: SetSchedulingToggleAction['payload'] = yield select(getSchedulingToggle);

Choose a reason for hiding this comment

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

This could be in its own selector isSchedulingEnabled


const calculateWindowStart = (
scheduleType: string | null,
scheduleTimestamp: any,

Choose a reason for hiding this comment

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

any type here

const depositValid = isValidScheduleDeposit(state);
const timeBountyValid = isValidCurrentTimeBounty(state);

return (

Choose a reason for hiding this comment

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

it would be nice if large conditionals like these were commented in groups for maintainability

@dternyak
Copy link
Contributor

dternyak commented Apr 12, 2018

Thanks a lot for the merge - we're getting really close here!

There are a few style issues that could be improved before this gets merged into develop:

  1. Date & Time and Timezone fields have values cut-off. If we decrease the Window field size and expand the others, there should be enough room for all elements. Stacking the Windows and Blocks toggles would further increase the room for the Date & Time and Timezone fields.

screen shot 2018-04-11 at 11 44 39 pm

  1. The Timezone selection has a large amount of options, making it difficult to select a relevant timezone. I'm not sure of an optimal solution, but we could potentially just shorten the number of options to the total possible timezones (e.g. GMT-1, GMT-2, ...).

  2. (Nitpick) Tooltips should be activated on hover over of the question icon, not labels.

Copy link
Contributor

@wbobeirne wbobeirne left a comment

Choose a reason for hiding this comment

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

Sorry for the delay on reviewing, I'm going to dismiss be previous request changes. Found a few other things in here, but other than the NewTabLink, I think everything looks good here. Ran a test on Kovan and it worked great.

interface InputTimeBountyIntentAction {
type: TypeKeys.TIME_BOUNTY_INPUT_INTENT;
payload: string;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Leftover unused actions

@@ -30,6 +30,8 @@ export enum TypeKeys {
GAS_LIMIT_INPUT = 'GAS_LIMIT_INPUT',
GAS_PRICE_INPUT = 'GAS_PRICE_INPUT',
GAS_PRICE_INPUT_INTENT = 'GAS_PRICE_INPUT_INTENT',
TIME_BOUNTY_INPUT = 'TIME_BOUNTY_INPUT',
TIME_BOUNTY_INPUT_INTENT = 'TIME_BOUNTY_INPUT_INTENT',
Copy link
Contributor

Choose a reason for hiding this comment

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

Leftover unused actions

let scheduleDetailsBtn: React.ReactElement<string> | undefined;
if (scheduling) {
scheduleDetailsBtn = (
<a href={getTXDetailsCheckURL(txHash)} className="btn btn-xs">
Copy link
Contributor

Choose a reason for hiding this comment

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

This should use the NewTabLink component.


&-field-title {
position: relative;
white-space: nowrap;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this may have caused some kind of issue with the tooltips:

screen shot 2018-04-12 at 1 42 25 pm

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed in: 5624221

if (windowStart) {
this.props.setCurrentWindowStart(windowStart);
} else {
this.props.setCurrentWindowStart(latestBlock);
Copy link
Contributor

Choose a reason for hiding this comment

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

We're going to need to kick off a fetch for latest block somewhere. Right now I think it only gets fetched when you change nodes. Looks like the default value is '???'.

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively we could just start with an empty field.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed the default value and we'll start with an empty field.

@wbobeirne wbobeirne dismissed their stale review April 12, 2018 18:02

Issues addressed

wbobeirne
wbobeirne previously approved these changes Apr 13, 2018
Copy link
Contributor

@wbobeirne wbobeirne left a comment

Choose a reason for hiding this comment

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

All of my comments have been addressed, this is. a 👍 from me. Looking forward to mainnet!

@dternyak dternyak changed the title [FEATURE] Ethereum Alarm Clock integration Ethereum Alarm Clock Integration Apr 13, 2018

return (
<div>
{timeBounty && timeBounty.value && timeBounty.value.toString()} + {gasPriceWei} *{' '}

Choose a reason for hiding this comment

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

No need for the .toString methods here, they'll get converted to a string regardless

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems they don't get converted implicitly. Removing the .toString methods results in an error:

Objects are not valid as a React child (found: object with keys {negative, words, length, red}). If you meant to render a collection of children, use an array instead```

@@ -69,17 +86,50 @@ class FeeSummary extends React.Component<Props> {
);

return (
<div className="FeeSummary">
<div className={`FeeSummary ${scheduling && 'SchedulingFeeSummary'}`}>

Choose a reason for hiding this comment

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

This boolean will add false to the classname if scheduling is false

@dternyak dternyak merged commit 985ea0f into MyCryptoHQ:develop Apr 14, 2018
@e00dan e00dan deleted the feature/eac-integration branch April 16, 2018 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants