Skip to content

Commit

Permalink
Use eth-method-registry to get method data
Browse files Browse the repository at this point in the history
  • Loading branch information
alextsg committed Jun 29, 2018
1 parent 9e34c10 commit 42ada41
Show file tree
Hide file tree
Showing 12 changed files with 221 additions and 70 deletions.
3 changes: 3 additions & 0 deletions app/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@
"enterPasswordContinue": {
"message": "Enter password to continue"
},
"parameters": {
"message": "Parameters"
},
"passwordNotLongEnough": {
"message": "Password not long enough"
},
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/transactions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class TransactionController extends EventEmitter {
// construct txMeta
let txMeta = this.txStateManager.generateTxMeta({ txParams: normalizedTxParams })
this.addTx(txMeta)
this.emit('newUnapprovedTx', txMeta)

try {
// check whether recipient account is blacklisted
Expand All @@ -171,7 +172,6 @@ class TransactionController extends EventEmitter {
txMeta.loadingDefaults = false
// save txMeta
this.txStateManager.updateTx(txMeta)
this.emit('newUnapprovedTx', txMeta)

return txMeta
}
Expand Down
139 changes: 104 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"eth-hd-keyring": "^1.2.1",
"eth-json-rpc-filters": "^1.2.6",
"eth-json-rpc-infura": "^3.0.0",
"eth-method-registry": "^1.0.0",
"eth-phishing-detect": "^1.1.4",
"eth-query": "^2.1.2",
"eth-sig-util": "^1.4.2",
Expand Down
14 changes: 2 additions & 12 deletions ui/app/components/input-number.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const {
addCurrencies,
conversionGTE,
conversionLTE,
subtractCurrencies,
} = require('../conversion-util')

module.exports = InputNumber
Expand Down Expand Up @@ -49,11 +51,7 @@ InputNumber.prototype.setValue = function (newValue) {
}

InputNumber.prototype.render = function () {
<<<<<<< HEAD
const { unitLabel, step = 1, placeholder, value } = this.props
=======
const { unitLabel, step = 1, placeholder, value = 0, min = -1, max = Infinity } = this.props
>>>>>>> Refactor and redesign confirm transaction views

return h('div.customize-gas-input-wrapper', {}, [
h('input', {
Expand All @@ -69,19 +67,11 @@ InputNumber.prototype.render = function () {
h('span.gas-tooltip-input-detail', {}, [unitLabel]),
h('div.gas-tooltip-input-arrows', {}, [
h('i.fa.fa-angle-up', {
<<<<<<< HEAD
onClick: () => this.setValue(addCurrencies(value, step, { toNumericBase: 'dec' })),
}),
h('i.fa.fa-angle-down', {
style: { cursor: 'pointer' },
onClick: () => this.setValue(subtractCurrencies(value, step, { toNumericBase: 'dec' })),
=======
onClick: () => this.setValue(Math.min(+value + step, max)),
}),
h('i.fa.fa-angle-down', {
style: { cursor: 'pointer' },
onClick: () => this.setValue(Math.max(+value - step, min)),
>>>>>>> Refactor and redesign confirm transaction views
}),
]),
])
Expand Down
Loading

0 comments on commit 42ada41

Please sign in to comment.