diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/abi.js | 7 | ||||
-rw-r--r-- | lib/contract.js | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/abi.js b/lib/abi.js index ecff1e5d6..1a92bf5e6 100644 --- a/lib/abi.js +++ b/lib/abi.js @@ -195,11 +195,16 @@ var signatureFromAscii = function (name) { return web3.sha3(web3.fromAscii(name)).slice(0, 2 + c.ETH_SIGNATURE_LENGTH * 2); }; +var eventSignatureFromAscii = function (name) { + return web3.sha3(web3.fromAscii(name)); +}; + module.exports = { inputParser: inputParser, outputParser: outputParser, formatInput: formatInput, formatOutput: formatOutput, - signatureFromAscii: signatureFromAscii + signatureFromAscii: signatureFromAscii, + eventSignatureFromAscii: eventSignatureFromAscii }; diff --git a/lib/contract.js b/lib/contract.js index 94a6d7dac..748844fec 100644 --- a/lib/contract.js +++ b/lib/contract.js @@ -124,7 +124,7 @@ var addEventRelatedPropertiesToContract = function (contract, desc, address) { Object.defineProperty(contract, 'topic', { get: function() { return utils.filterEvents(desc).map(function (e) { - return abi.signatureFromAscii(e.name); + return abi.eventSignatureFromAscii(e.name); }); } }); @@ -137,7 +137,7 @@ var addEventsToContract = function (contract, desc, address) { var impl = function () { var params = Array.prototype.slice.call(arguments); - var signature = abi.signatureFromAscii(e.name); + var signature = abi.eventSignatureFromAscii(e.name); var event = eventImpl(address, signature, e); var o = event.apply(null, params); return web3.eth.watch(o); |