These are chat archives for Nethereum/Nethereum

18th
Nov 2017
Juan Blanco
@juanfranblanco
Nov 18 2017 16:52
it is one of the values in the transaction
you can use the current number of transactions as the value (if you have not submitted any higher nonce value before)
rfeiner3
@rfeiner3
Nov 18 2017 20:38
Hi all, I have a strange issue -- when using Nethereum to fetch events from a specific contract, Nethereum seems to pull the events for said contract, but also for previously deployed contracts that have the same ABI. Has anyone encountered anything like this?
Juan Blanco
@juanfranblanco
Nov 18 2017 20:40
that should not happen as filtering is based first on the contract
rfeiner3
@rfeiner3
Nov 18 2017 20:46
It's most likely that this is not a Nethereum issue, but I thought I'd ask in case it was a known bug.
Juan Blanco
@juanfranblanco
Nov 18 2017 20:46
what client are you using? Geth / Parity?
rfeiner3
@rfeiner3
Nov 18 2017 20:49
Infura
Juan Blanco
@juanfranblanco
Nov 18 2017 20:49
ah then it can be any
ill mention it to them
but the issue will relate to a client
Juan Blanco
@juanfranblanco
Nov 18 2017 21:01
can you post some info on this?
rfeiner3
@rfeiner3
Nov 18 2017 21:04
My issue sounds like it may be related to the last post here: INFURA/infura#10
Juan Blanco
@juanfranblanco
Nov 18 2017 21:06
oh for infura I will use getLogs
not create a filter
(if you are not doing that already)
getLogs + FilterInput
tracking previous blocks you have done the call
rfeiner3
@rfeiner3
Nov 18 2017 21:11
I'm currently doing this:
var contractEvent = _foregroundContract.GetEvent(eventName);
        var topics = GetFilterTopics(contractEvent, firstFilter, secondFilter);

        var events = await contractEvent.GetAllChanges<T>(
            new Nethereum.RPC.Eth.Filters.NewFilterInput
            {
                FromBlock = new BlockParameter(startingBlock),
                Topics = topics
            });

        return events.Where(e => e.Log.BlockNumber != null).ToList();
rfeiner3
@rfeiner3
Nov 18 2017 21:35
Fixed. I had to specify the address in the filter:
new Nethereum.RPC.Eth.Filters.NewFilterInput
{
FromBlock = new BlockParameter(startingBlock),
Topics = topics,
Address = new string[] { _Contract.Address }
});