Merge pull request #811 from ethereum/fixAddressInput

Fix address input
pull/1/head
yann300 7 years ago committed by GitHub
commit 56fdb93aa6
  1. 4
      src/app/execution/eventsDecoder.js
  2. 1
      src/app/execution/txFormat.js
  3. 3
      src/app/execution/txHelper.js
  4. 1
      src/app/execution/txListener.js
  5. 5
      src/app/ui/renderer.js

@ -85,6 +85,7 @@ class EventsDecoder {
var encodedData = log.topics[indexed].replace('0x', '')
try {
decoded[index] = ethJSABI.rawDecode([item.type], new Buffer(encodedData, 'hex'))[0]
decoded[index] = ethJSABI.stringify([item.type], decoded[index])
} catch (e) {
decoded[index] = encodedData
}
@ -94,7 +95,8 @@ class EventsDecoder {
}
})
// decode non indexed param
nonindexed = ethJSABI.rawDecode(nonindexed, new Buffer(log.data.replace('0x', ''), 'hex'))
var nonindexededResult = ethJSABI.rawDecode(nonindexed, new Buffer(log.data.replace('0x', ''), 'hex'))
nonindexed = ethJSABI.stringify(nonindexed, nonindexededResult)
// ordering
var j = 0
abi.inputs.map(function (item, index) {

@ -155,6 +155,7 @@ module.exports = {
var decodedObj = ethJSABI.rawDecode(outputTypes, response)
// format decoded data
decodedObj = ethJSABI.stringify(outputTypes, decodedObj)
var json = {}
for (i = 0; i < outputTypes.length; i++) {
var name = fnabi.outputs[i].name

@ -12,9 +12,6 @@ module.exports = {
if (args.length < types.length) {
args.push('')
}
if (args[i].indexOf && args[i].indexOf('0x') === 0) {
args[i] = new Buffer(args[i].replace('0x', ''), 'hex')
}
}
}

@ -307,6 +307,7 @@ class TxListener {
inputTypes.push(abi.inputs[i].type)
}
var decoded = ethJSABI.rawDecode(inputTypes, data)
decoded = ethJSABI.stringify(inputTypes, decoded)
var ret = {}
for (var k in abi.inputs) {
ret[abi.inputs[k].type + ' ' + abi.inputs[k].name] = decoded[k]

@ -44,13 +44,12 @@ Renderer.prototype.error = function (message, container, options) {
$error.click(function (ev) {
options && options.click ? options.click(errFile, errLine, errCol) : self.appAPI.errorClick(errFile, errLine, errCol)
})
} else {
if (options.click) {
} else if (options && options.click) {
$error.click(function (ev) {
options.click(message)
})
}
}
$error.find('.close').click(function (ev) {
ev.preventDefault()
$error.remove()

Loading…
Cancel
Save