diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-09-06 18:00:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-06 18:00:35 +0800 |
commit | c4d21bc8e548d909d5b2940cb00d3d068f5697ec (patch) | |
tree | 1747315b32a6c9d9158fb9f36cfbd2277672ddfb /eth/backend_test.go | |
parent | 160add8570ea1653b46cc1f7c21cb6eb69220f7d (diff) | |
parent | 564c8f3ae6f80d039ef27479e5ad15145f488710 (diff) | |
download | dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.gz dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.bz2 dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.lz dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.xz dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.zst dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.zip |
Merge pull request #14631 from zsfelfoldi/bloombits2
core/bloombits, eth/filter: transformed bloom bitmap based log search
Diffstat (limited to 'eth/backend_test.go')
-rw-r--r-- | eth/backend_test.go | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/eth/backend_test.go b/eth/backend_test.go deleted file mode 100644 index 1fd25e95a..000000000 --- a/eth/backend_test.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2015 The go-ethereum Authors -// This file is part of the go-ethereum library. -// -// The go-ethereum library is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// The go-ethereum library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. - -package eth - -import ( - "math/big" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/params" -) - -func TestMipmapUpgrade(t *testing.T) { - db, _ := ethdb.NewMemDatabase() - addr := common.BytesToAddress([]byte("jeff")) - genesis := new(core.Genesis).MustCommit(db) - - chain, receipts := core.GenerateChain(params.TestChainConfig, genesis, db, 10, func(i int, gen *core.BlockGen) { - switch i { - case 1: - receipt := types.NewReceipt(nil, false, new(big.Int)) - receipt.Logs = []*types.Log{{Address: addr}} - gen.AddUncheckedReceipt(receipt) - case 2: - receipt := types.NewReceipt(nil, false, new(big.Int)) - receipt.Logs = []*types.Log{{Address: addr}} - gen.AddUncheckedReceipt(receipt) - } - }) - for i, block := range chain { - core.WriteBlock(db, block) - if err := core.WriteCanonicalHash(db, block.Hash(), block.NumberU64()); err != nil { - t.Fatalf("failed to insert block number: %v", err) - } - if err := core.WriteHeadBlockHash(db, block.Hash()); err != nil { - t.Fatalf("failed to insert block number: %v", err) - } - if err := core.WriteBlockReceipts(db, block.Hash(), block.NumberU64(), receipts[i]); err != nil { - t.Fatal("error writing block receipts:", err) - } - } - - err := addMipmapBloomBins(db) - if err != nil { - t.Fatal(err) - } - - bloom := core.GetMipmapBloom(db, 1, core.MIPMapLevels[0]) - if (bloom == types.Bloom{}) { - t.Error("got empty bloom filter") - } - - data, _ := db.Get([]byte("setting-mipmap-version")) - if len(data) == 0 { - t.Error("setting-mipmap-version not written to database") - } -} |