Beispiel #1
0
        public bool Initialized_storage_contain_blocks_as_db(long from, long to)
        {
            var memColumnsDb = _bloomDb;

            memColumnsDb.Set(BloomStorage.MinBlockNumberKey, 1L.ToBigEndianByteArrayWithoutLeadingZeros());
            memColumnsDb.Set(BloomStorage.MaxBlockNumberKey, 11L.ToBigEndianByteArrayWithoutLeadingZeros());
            var storage = new BloomStorage(_config, memColumnsDb, _fileStoreFactory);

            return(storage.ContainsRange(from, to));
        }
Beispiel #2
0
        public bool Contain_blocks_after_store(long from, long to)
        {
            var storage = new BloomStorage(_config, _bloomDb, _fileStoreFactory);

            for (long i = 1; i < 11; i++)
            {
                storage.Store(i, Core.Bloom.Empty);
            }

            return(storage.ContainsRange(from, to));
        }
Beispiel #3
0
        public void Empty_storage_does_not_contain_blocks(long from, long to)
        {
            var storage = new BloomStorage(_config, _bloomDb, _fileStoreFactory);

            storage.ContainsRange(from, to).Should().BeFalse();
        }