public bool Accepts(ref LogEntryStructRef entry) { if (entry.Topics != null) { return(Accepts(entry.Topics)); } var iterator = new KeccaksIterator(entry.TopicsRlp); for (int i = 0; i < _expressions.Length; i++) { if (iterator.TryGetNext(out var keccak)) { if (!_expressions[i].Accepts(ref keccak)) { return(false); } } else { return(false); } } return(true); }
public bool TryGetNext(out LogEntryStructRef current) { if (_decoderContext.Position < _length) { LogEntryDecoder.Instance.DecodeStructRef(ref _decoderContext, RlpBehaviors.None, out current); Index++; return(true); } else { current = new LogEntryStructRef(); return(false); } }
public static void DecodeStructRef(ref Rlp.ValueDecoderContext decoderContext, RlpBehaviors storage, out LogEntryStructRef item) { if (decoderContext.IsNextItemNull()) { decoderContext.ReadByte(); item = new LogEntryStructRef(); return; } decoderContext.ReadSequenceLength(); decoderContext.DecodeAddressStructRef(out var address); var peekPrefixAndContentLength = decoderContext.PeekPrefixAndContentLength(); var sequenceLength = peekPrefixAndContentLength.PrefixLength + peekPrefixAndContentLength.ContentLength; var topics = decoderContext.Data.Slice(decoderContext.Position, sequenceLength); decoderContext.SkipItem(); var data = decoderContext.DecodeByteArraySpan(); item = new LogEntryStructRef(address, data, topics); }
public bool TryGetNext(out LogEntryStructRef current) { if (_logs is null) { if (_decoderContext.Position < _length) { LogEntryDecoder.DecodeStructRef(ref _decoderContext, RlpBehaviors.None, out current); Index++; return(true); } } else { if (++Index < _length) { current = new LogEntryStructRef(_logs[Index]); return(true); } } current = new LogEntryStructRef(); return(false); }
public bool Accepts(ref LogEntryStructRef logEntry) => AddressFilter.Accepts(ref logEntry.LoggersAddress) && TopicsFilter.Accepts(ref logEntry);
public abstract bool Accepts(ref LogEntryStructRef entry);