public void or_topics_filter_matches_bloom()
        {
            var filter = FilterBuilder.New(ref _filterCounter)
                         .WithTopicExpressions(TestTopicExpressions.Or(TestTopicExpressions.Specific(TestItem.KeccakB), TestTopicExpressions.Specific(TestItem.KeccakA)))
                         .Build();

            var bloom = GetBloom(GetLogEntry(TestItem.AddressB, TestItem.KeccakB));

            filter.Matches(bloom).Should().BeTrue();
        }
        public void complex_topics_filter_doesnt_match_bloom()
        {
            var filter = FilterBuilder.New(ref _filterCounter)
                         .WithTopicExpressions(TestTopicExpressions.Specific(TestItem.KeccakA), TestTopicExpressions.Or(TestTopicExpressions.Specific(TestItem.KeccakB), TestTopicExpressions.Specific(TestItem.KeccakA)))
                         .Build();

            var bloom = GetBloom(GetLogEntry(TestItem.AddressA, TestItem.KeccakC));

            filter.Matches(bloom).Should().BeFalse();
        }
 public void logs_should_be_empty_for_non_existing_or_topic()
 => LogsShouldBeEmpty(filter => filter
                      .WithTopicExpressions(TestTopicExpressions.Or(new[]
 {
     TestTopicExpressions.Specific(TestItem.KeccakA),
     TestTopicExpressions.Specific(TestItem.KeccakD)
 })),
                      receipt => receipt
                      .WithLogs(new[]
                                { Build.A.LogEntry.WithTopics(new[] { TestItem.KeccakB, TestItem.KeccakC }).TestObject }));
 public void logs_should_be_empty_for_existing_block_and_addresses_and_non_existing_topic()
 => LogsShouldBeEmpty(filter => filter
                      .FromBlock(1L)
                      .ToBlock(10L)
                      .WithAddresses(new[] { TestItem.AddressA, TestItem.AddressB })
                      .WithTopicExpressions(TestTopicExpressions.Or(new[]
 {
     TestTopicExpressions.Specific(TestItem.KeccakC),
     TestTopicExpressions.Specific(TestItem.KeccakD)
 })),
                      receipt => receipt
                      .WithBlockNumber(6L)
                      .WithLogs(new[]
 {
     Build.A.LogEntry.WithAddress(TestItem.AddressA)
     .WithTopics(new[] { TestItem.KeccakB, TestItem.KeccakC }).TestObject
 }));
 public void logs_should_not_be_empty_for_existing_block_and_address_and_topics()
 => LogsShouldNotBeEmpty(filter => filter
                         .FromBlock(UInt256.One)
                         .ToBlock(new UInt256(10))
                         .WithAddress(TestItem.AddressA)
                         .WithTopicExpressions(TestTopicExpressions.Or(new[]
 {
     TestTopicExpressions.Specific(TestItem.KeccakB),
     TestTopicExpressions.Specific(TestItem.KeccakD)
 })),
                         receipt => receipt
                         .WithBlockNumber(new UInt256(6))
                         .WithLogs(new[]
 {
     Build.A.LogEntry.WithAddress(TestItem.AddressA)
     .WithTopics(new[] { TestItem.KeccakB, TestItem.KeccakC }).TestObject
 }));
 public void logs_should_not_be_empty_for_existing_specific_topic()
 => LogsShouldNotBeEmpty(filter => filter
                         .WithTopicExpressions(TestTopicExpressions.Specific(TestItem.KeccakA)),
                         receipt => receipt
                         .WithLogs(new[]
                                   { Build.A.LogEntry.WithTopics(new[] { TestItem.KeccakA, TestItem.KeccakB }).TestObject }));