good morning!!!!

Skip to content
Snippets Groups Projects
Commit 600c9dd2 authored by Marek Kotewicz's avatar Marek Kotewicz
Browse files

topics are deprecated

parent e3804625
No related branches found
No related tags found
No related merge requests found
...@@ -541,7 +541,7 @@ var addFunctionsToContract = function (contract, desc, address) { ...@@ -541,7 +541,7 @@ var addFunctionsToContract = function (contract, desc, address) {
var addEventRelatedPropertiesToContract = function (contract, desc, address) { var addEventRelatedPropertiesToContract = function (contract, desc, address) {
contract.address = address; contract.address = address;
Object.defineProperty(contract, 'topics', { Object.defineProperty(contract, 'topic', {
get: function() { get: function() {
return abi.filterEvents(desc).map(function (e) { return abi.filterEvents(desc).map(function (e) {
return abi.methodSignature(e.name); return abi.methodSignature(e.name);
...@@ -565,7 +565,7 @@ var addEventsToContract = function (contract, desc, address) { ...@@ -565,7 +565,7 @@ var addEventsToContract = function (contract, desc, address) {
impl.address = address; impl.address = address;
Object.defineProperty(impl, 'topics', { Object.defineProperty(impl, 'topic', {
get: function() { get: function() {
return [abi.methodSignature(e.name)]; return [abi.methodSignature(e.name)];
} }
...@@ -706,10 +706,13 @@ var Filter = function(options, impl) { ...@@ -706,10 +706,13 @@ var Filter = function(options, impl) {
if (typeof options !== "string") { if (typeof options !== "string") {
// evaluate lazy properties // evaluate lazy properties
if (options.topics) {
console.warn('"topics" is deprecated, use "topic" instead');
}
options = { options = {
to: options.to, to: options.to,
topic: options.topic, topic: options.topic,
topics: options.topics,
earliest: options.earliest, earliest: options.earliest,
latest: options.latest, latest: options.latest,
max: options.max, max: options.max,
......
This diff is collapsed.
This diff is collapsed.
...@@ -110,7 +110,7 @@ var addFunctionsToContract = function (contract, desc, address) { ...@@ -110,7 +110,7 @@ var addFunctionsToContract = function (contract, desc, address) {
var addEventRelatedPropertiesToContract = function (contract, desc, address) { var addEventRelatedPropertiesToContract = function (contract, desc, address) {
contract.address = address; contract.address = address;
Object.defineProperty(contract, 'topics', { Object.defineProperty(contract, 'topic', {
get: function() { get: function() {
return abi.filterEvents(desc).map(function (e) { return abi.filterEvents(desc).map(function (e) {
return abi.methodSignature(e.name); return abi.methodSignature(e.name);
...@@ -134,7 +134,7 @@ var addEventsToContract = function (contract, desc, address) { ...@@ -134,7 +134,7 @@ var addEventsToContract = function (contract, desc, address) {
impl.address = address; impl.address = address;
Object.defineProperty(impl, 'topics', { Object.defineProperty(impl, 'topic', {
get: function() { get: function() {
return [abi.methodSignature(e.name)]; return [abi.methodSignature(e.name)];
} }
......
...@@ -33,10 +33,13 @@ var Filter = function(options, impl) { ...@@ -33,10 +33,13 @@ var Filter = function(options, impl) {
if (typeof options !== "string") { if (typeof options !== "string") {
// evaluate lazy properties // evaluate lazy properties
if (options.topics) {
console.warn('"topics" is deprecated, use "topic" instead');
}
options = { options = {
to: options.to, to: options.to,
topic: options.topic, topic: options.topic,
topics: options.topics,
earliest: options.earliest, earliest: options.earliest,
latest: options.latest, latest: options.latest,
max: options.max, max: options.max,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment