コード例 #1
0
        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);
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: LogFilter.cs プロジェクト: rafal-mz/nethermind
 public bool Accepts(ref LogEntryStructRef logEntry) => AddressFilter.Accepts(ref logEntry.LoggersAddress) && TopicsFilter.Accepts(ref logEntry);
コード例 #6
0
 public abstract bool Accepts(ref LogEntryStructRef entry);