From 842b8cf323a3b39d9e29ddd831bc41ddb98279ad Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Thu, 29 Jan 2015 12:35:21 +0100 Subject: event.js --- lib/event.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/event.js (limited to 'lib/event.js') diff --git a/lib/event.js b/lib/event.js new file mode 100644 index 000000000..724acde81 --- /dev/null +++ b/lib/event.js @@ -0,0 +1,16 @@ + +var abi = require('./abi'); + +var implementationOfEvent = function (event, address, signature) { + + return function (options) { + var o = options || {}; + o.address = o.address || address; + o.topics = o.topics || []; + o.topics.push(signature); + return o; + }; +}; + +module.exports = implementationOfEvent; + -- cgit v1.2.3 From c8ee08c24bee9ab994822066f9abe94448c4ae89 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Thu, 29 Jan 2015 13:32:32 +0100 Subject: contract.js simplified --- lib/event.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/event.js') diff --git a/lib/event.js b/lib/event.js index 724acde81..e8312ccdb 100644 --- a/lib/event.js +++ b/lib/event.js @@ -1,7 +1,7 @@ var abi = require('./abi'); -var implementationOfEvent = function (event, address, signature) { +var implementationOfEvent = function (address, signature) { return function (options) { var o = options || {}; -- cgit v1.2.3 From df17c338988260aab4db8f946076a67f3323caba Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Thu, 29 Jan 2015 15:05:43 +0100 Subject: event example --- lib/event.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'lib/event.js') diff --git a/lib/event.js b/lib/event.js index e8312ccdb..ae2195381 100644 --- a/lib/event.js +++ b/lib/event.js @@ -1,5 +1,24 @@ +/* + This file is part of ethereum.js. -var abi = require('./abi'); + ethereum.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ethereum.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with ethereum.js. If not, see . +*/ +/** @file event.js + * @authors: + * Marek Kotewicz + * @date 2014 + */ var implementationOfEvent = function (address, signature) { -- cgit v1.2.3