This repository has been archived by the owner on Sep 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Adding rinkeby support #2723
Merged
Merged
Adding rinkeby support #2723
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5ce5eba
Adding Rinkeby support
evertonfraga e779711
Setting rinkeby in i18n onboarding files
evertonfraga d87fbd3
Rinkeby on network detection
evertonfraga ce3d15d
Onboarding copy changes
evertonfraga c71b068
Minor typo in DE i18n file
evertonfraga c4c26fc
Showing actual testnet names on sidebar
evertonfraga 93cca08
Merge branch 'develop' into add-rinkeby-support
evertonfraga a27e5b9
ESLint
evertonfraga ba3e2e6
Merge branch 'add-rinkeby-support' of https://github.com/ethereum/mis…
evertonfraga 80f9bd5
ESLint
evertonfraga 470e06c
Refactor
evertonfraga aea024c
fixes some onboarding behavior
duckized f9a142a
do not show new account if you already have one
duckized 041f340
Merge branch 'add-rinkeby-support' of https://github.com/ethereum/mis…
evertonfraga 29f4e62
Adding support for private network (`geth --dev`)
evertonfraga afc4a52
ESLint
evertonfraga 1caa03d
Fix i18n key case
evertonfraga 23d2cd9
Merge branch 'develop' into add-rinkeby-support
frozeman 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
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -48,6 +48,7 @@ | |
|
||
button, a.button { | ||
font-size: 110%; | ||
text-align: left; | ||
} | ||
} | ||
|
||
|
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
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
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
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
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 |
---|---|---|
|
@@ -28,8 +28,8 @@ var getPeerCount = function (template) { | |
|
||
Template['popupWindows_onboardingScreen'].onCreated(function () { | ||
var template = this; | ||
var oldData; | ||
TemplateVar.set('readyToLaunch', false); | ||
TemplateVar.set('newAccount', false); | ||
|
||
// check for block status | ||
this.syncFilter = web3.eth.isSyncing(function (error, syncing) { | ||
|
@@ -39,7 +39,7 @@ Template['popupWindows_onboardingScreen'].onCreated(function () { | |
web3.reset(true); | ||
} else if (_.isObject(syncing)) { | ||
// loads syncing data and adds it to old by using 'extend' | ||
var oldData = TemplateVar.get(template, 'syncing'); | ||
oldData = TemplateVar.get(template, 'syncing'); | ||
|
||
TemplateVar.set(template, 'syncing', _.extend(oldData || {}, syncing || {})); | ||
|
||
|
@@ -50,6 +50,15 @@ Template['popupWindows_onboardingScreen'].onCreated(function () { | |
}); | ||
|
||
|
||
TemplateVar.set('newAccount', false); | ||
web3.eth.getAccounts((err, acc) => { | ||
console.log('newAccount', err, acc); | ||
if (acc.length > 0) { | ||
TemplateVar.set(template, 'newAccount', acc[0]); | ||
} | ||
}); | ||
|
||
|
||
// CHECK PEER COUNT | ||
this.peerCountIntervalId = null; | ||
|
||
|
@@ -72,7 +81,7 @@ Template['popupWindows_onboardingScreen'].onCreated(function () { | |
|
||
|
||
Template['popupWindows_onboardingScreen'].helpers({ | ||
'newAccountLowerCase': function () { | ||
newAccountLowerCase() { | ||
var account = TemplateVar.get('newAccount'); | ||
return (account) ? account.toLowerCase() : ''; | ||
}, | ||
|
@@ -81,7 +90,7 @@ Template['popupWindows_onboardingScreen'].helpers({ | |
|
||
@method syncStatus | ||
*/ | ||
'syncStatus': function () { | ||
syncStatus() { | ||
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. Thats ES6 right here, if we would remove the ecmascript package, this would break. |
||
|
||
// This functions loops trhough numbers while waiting for the node to respond | ||
var template = Template.instance(); | ||
|
@@ -138,34 +147,38 @@ Template['popupWindows_onboardingScreen'].helpers({ | |
|
||
@method syncStatusMessage | ||
*/ | ||
'syncStatusMessage': function () { | ||
syncStatusMessage() { | ||
return TemplateVar.get('syncStatusMessageLive'); | ||
} | ||
}); | ||
|
||
Template['popupWindows_onboardingScreen'].events({ | ||
'click .goto-start': function (e) { | ||
'click .goto-start': function () { | ||
TemplateVar.set('currentActive', 'start'); | ||
}, | ||
'click .goto-import-account': function () { | ||
TemplateVar.set('currentActive', 'import-account'); | ||
|
||
// if testnet, make sure to switch to the mainnet | ||
if (TemplateVar.get('testnet')) { | ||
ipc.send('onBoarding_changeNet', false); | ||
ipc.send('onBoarding_changeNet', /* isTestNet: */ false); | ||
TemplateVar.set('testnet', false); | ||
TemplateVar.set('syncing', null); | ||
} | ||
}, | ||
'click .start-testnet': function (e, template) { | ||
if (!TemplateVar.get('testnet')) { | ||
ipc.send('onBoarding_changeNet', true); | ||
ipc.send('onBoarding_changeNet', /* isMainNet: */ true); | ||
TemplateVar.set('testnet', true); | ||
TemplateVar.set('syncing', null); | ||
} | ||
|
||
TemplateVar.set('currentActive', 'testnet'); | ||
template.$('.onboarding-testnet input.password').focus(); | ||
if (!TemplateVar.get('newAccount')) { | ||
TemplateVar.set('currentActive', 'testnet'); | ||
template.$('.onboarding-testnet input.password').focus(); | ||
} else { | ||
TemplateVar.set('currentActive', 'account'); | ||
} | ||
}, | ||
'click .goto-password': function (e, template) { | ||
TemplateVar.set('currentActive', 'password'); | ||
|
@@ -262,7 +275,7 @@ Template['popupWindows_onboardingScreen_importAccount'].events({ | |
if (files.length) { | ||
ipc.send('backendAction_checkWalletFile', files[0].path); | ||
|
||
ipc.on('uiAction_checkedWalletFile', function (e, error, type) { | ||
ipc.on('uiAction_checkedWalletFile', function (ev, error, type) { | ||
switch (type) { | ||
case 'presale': | ||
console.log(`Imported ${type} account`); | ||
|
@@ -318,7 +331,7 @@ Template['popupWindows_onboardingScreen_importAccount'].events({ | |
ipc.send('backendAction_importWalletFile', TemplateVar.get('filePath'), pw); | ||
|
||
TemplateVar.set('importing', true); | ||
ipc.on('uiAction_importedWalletFile', function (e, error, address) { | ||
ipc.on('uiAction_importedWalletFile', function (ev, error, address) { | ||
TemplateVar.set(template, 'importing', false); | ||
TemplateVar.set(template, 'filePath', false); | ||
|
||
|
@@ -347,7 +360,8 @@ Template['popupWindows_onboardingScreen_importAccount'].events({ | |
}); | ||
} else { | ||
GlobalNotification.warning({ | ||
content: TAPi18n.__('mist.popupWindows.onboarding.errors.importFailed', { error: error }), | ||
content: TAPi18n.__('mist.popupWindows.onboarding.errors.importFailed', { error | ||
}), | ||
duration: 4 | ||
}); | ||
} | ||
|
@@ -404,8 +418,8 @@ Template['popupWindows_onboardingScreen_password'].events({ | |
@event click button[type="button"] | ||
*/ | ||
'input input, change input': function (e, template) { | ||
var pw = template.find('input.password').value, | ||
pwRepeat = template.find('input.password-repeat').value; | ||
var pw = template.find('input.password').value; | ||
var pwRepeat = template.find('input.password-repeat').value; | ||
|
||
TemplateVar.set(template, 'passwordsNotEmpty', pw !== '' || pwRepeat !== ''); | ||
TemplateVar.set(template, 'passwordsMismatch', pwRepeat && pw !== pwRepeat); | ||
|
@@ -417,8 +431,8 @@ Template['popupWindows_onboardingScreen_password'].events({ | |
@event submit form | ||
*/ | ||
'submit form': function (e, template) { | ||
var pw = template.find('input.password').value, | ||
pwRepeat = template.find('input.password-repeat').value; | ||
var pw = template.find('input.password').value; | ||
var pwRepeat = template.find('input.password-repeat').value; | ||
|
||
if (pw !== pwRepeat) { | ||
GlobalNotification.warning({ | ||
|
@@ -438,12 +452,13 @@ Template['popupWindows_onboardingScreen_password'].events({ | |
// notifiy about backing up! | ||
alert(TAPi18n.__('mist.popupWindows.requestAccount.backupHint')); | ||
|
||
if(!e) { | ||
if (!e) { | ||
TemplateVar.setTo('.onboarding-account', 'newAccount', web3.toChecksumAddress(res)); | ||
TemplateVar.setTo('.onboarding-screen', 'currentActive', 'account'); | ||
|
||
// clear form | ||
pw = pwRepeat = null; | ||
pw = null; | ||
pwRepeat = null; | ||
|
||
} else { | ||
GlobalNotification.warning({ | ||
|
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
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
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
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
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
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.
I would have made that camelCase
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.
@frozeman done.