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

Refactor dropdown logic #2506

Merged
merged 15 commits into from
Dec 30, 2019
Merged

Refactor dropdown logic #2506

merged 15 commits into from
Dec 30, 2019

Conversation

iurimatias
Copy link
Member

(finally) extracts the modal/confirm dialogs from the dropdown logic, moves logic related to execution context and udapp into a blockchain module


const compilerContracts = this.dropdownLogic.getCompilerContracts()
const confirmationCb = this.getConfirmationCb(modalDialog, confirmDialog)

Copy link
Collaborator

Choose a reason for hiding this comment

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

As you have only one source of error possible I would recommend :

try {
  const contractMetadata = await this.runView.call('compilerMetadata', 'deployMetadataOf', selectedContract.name)
  const compilerContracts = this.dropdownLogic.getCompilerContracts()
  const confirmationCb = this.getConfirmationCb(modalDialog, confirmDialog)
} catch (error) {
  return statusCb(`creation of ${selectedContract.name} errored: ` + error)
}

if (!content.gasPriceStatus) {
cancelCb('Given gas price is not correct')
} else {
var gasPrice = this.dropdownLogic.toWei(content.querySelector('#gasprice').value, 'gwei')
Copy link
Collaborator

Choose a reason for hiding this comment

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

use const when adding new piece of code.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll do the whole syntax update stuff on the remix-side of things in a different PR (just like for remix)

determineGasFees (tx) {
const determineGasFeesCb = (gasPrice, cb) => {
let txFeeText, priceStatus
// TODO: this try catch feels like an anti pattern, can/should be
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you create an issue for that and reference it here: TODO(#1234) ... ?

@iurimatias iurimatias merged commit 00aea1d into master Dec 30, 2019
@iurimatias iurimatias deleted the refactor_logic1 branch December 30, 2019 18:35
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.

2 participants