fixed event signatures

pull/296/head
Marek Kotewicz 10 years ago
parent e6c0ec7278
commit d5166918e9
  1. 11
      dist/ethereum.js
  2. 6
      dist/ethereum.js.map
  3. 2
      dist/ethereum.min.js
  4. 7
      lib/abi.js
  5. 4
      lib/contract.js

11
dist/ethereum.js vendored

@ -196,12 +196,17 @@ 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
};
@ -367,7 +372,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);
});
}
});
@ -380,7 +385,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);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -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
};

@ -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);

Loading…
Cancel
Save