Open SCBuergel opened 7 years ago
When going more low-level via filter
it turns out that actually there is just one event being fired (as the Ethereum Console suggested already):
var filter = web3.eth.filter({fromBlock:0, toBlock: 'latest', address: contractAddress});
filter.watch(function(error, result) {
console.log('----->>> filter watch: ' + JSON.stringify(result));
if (error)
console.log('error: ' + error);
})
This produces one output per event, e.g. (here I called 3 functions):
----->>> filter watch: {"logIndex":0,"transactionIndex":1,"transactionHash":"0xc256a9905d90abe8cab06806fcce7a03e829c151d37d59b7ff1a0428de8a5cc9","blockHash":"0x6e704396137cdcb3020e692fb9363fed8daa65ff3b1f5b8d7a836d12abc573f0","blockNumber":5,"address":"0x86e0497e32a8e1d79fe38ab87dc80140df5470d9","data":"0x000000000000000000000000000000000000000000000000000000000000007b","topics":["0x3680e78b6fdf571695c81f108d81181ea63f50c100e6375e765b14bd7ac0adbb"]}
----->>> filter watch: {"logIndex":0,"transactionIndex":1,"transactionHash":"0xd1d01d8da34ad1c5db6776fb9589cf4c2cbb7e398cab7209739d216de6c40d2d","blockHash":"0x47cc815f1517fd7e7fa19dcff37ca07cac562cec610f73f649f14f161a9dd6d2","blockNumber":32,"address":"0x86e0497e32a8e1d79fe38ab87dc80140df5470d9","data":"0x00000000000000000000000000000000000000000000000000000000000000de","topics":["0xf04f5fc87a72102f7c0b228f8bbaf9b9aa7a2b5dc295c86538fdde91e95866e9"]}
----->>> filter watch: {"logIndex":0,"transactionIndex":1,"transactionHash":"0x28947e0240d1cc59b184a17485a4c1ab12c82e4dcf01f9a6d8c47897d2948fa0","blockHash":"0x85d314207deae9ff53ad2ff0a5d8dfe3a082a89b6087c5237b76cd487ddcbe74","blockNumber":52,"address":"0x86e0497e32a8e1d79fe38ab87dc80140df5470d9","data":"0x000000000000000000000000000000000000000000000000000000000000014d","topics":["0x6fbec89a9bad4c7daaf5b053ac2c5ad4e0ff33c287295fe9a98cf7f3a3043f9c"]}
This suggests that we have an issue on the listener side or in the "event producer".
My last statement
This produces one output per event
is not generally correct - as described in https://github.com/ether-camp/ethereum-sandbox/issues/74 but that is IMO an unrelated issue.
This is my test contract
A.sol
(in foldertest
on sbuergel.by.ether.camp):I interface it via the following nodeJS code
test.js
:The following is the expected output from my nodeJS program on startup, this is fine:
Now I call the function
f1
from the sandbox and get in the Ethereum Console the expected outputSandbox Event (A.e1): 123
. My nodeJS program prints also as expected:Now I simply stop the nodeJS program and start it again and receive the following wrong output:
It seems that something is wrong with the filters, here it should only
get
the eventse1
and not alsoe2
ande3
.