From b98a95d1aad4242df6d5c00ee9fc82a2a7756a76 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 15 Aug 2017 16:53:03 +0200 Subject: [PATCH] remove code for event --- src/universal-dapp.js | 57 ------------------------------------------- 1 file changed, 57 deletions(-) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 5e8d4d8967..6693f7f631 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -248,63 +248,7 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa copy(address) } - var $events = $('
') - - var parseLogs = function (err, response) { - if (err) { - return - } - - var $event = $('
') - - var close = yo`
` - function remove () { $event.remove() } - - $event.append($('').text(response.event)) - .append($('').text(JSON.stringify(response.args, null, 2))) - $event.get(0).appendChild(close) - $events.append($event) - } - var abi = txHelper.sortAbiFunction(contract) - if (this.executionContext.isVM()) { - // FIXME: support indexed events - var eventABI = {} - $.each(abi, function (i, funABI) { - if (funABI.type !== 'event') { - return - } - - var hash = ethJSABI.eventID(funABI.name, funABI.inputs.map(function (item) { return item.type })) - eventABI[hash.toString('hex')] = { event: funABI.name, inputs: funABI.inputs } - }) - - this.vm.on('afterTx', function (response) { - for (var i in response.vm.logs) { - // [address, topics, mem] - var log = response.vm.logs[i] - var event - var decoded - - try { - var abi = eventABI[log[1][0].toString('hex')] - event = abi.event - var types = abi.inputs.map(function (item) { - return item.type - }) - decoded = ethJSABI.rawDecode(types, log[2]) - decoded = ethJSABI.stringify(types, decoded) - } catch (e) { - decoded = '0x' + log[2].toString('hex') - } - - parseLogs(null, { event: event, args: decoded }) - } - }) - } else { - var eventFilter = this.web3.eth.contract(abi).at(address).allEvents() - eventFilter.watch(parseLogs) - } $instance.get(0).appendChild(title) @@ -330,7 +274,6 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa })) }) - $instance.append($events) return $instance.get(0) }