aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_indexer_test.go
diff options
context:
space:
mode:
authorFelföldi Zsolt <zsfelfoldi@gmail.com>2018-08-16 04:25:46 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-08-16 04:25:46 +0800
commit2cdf6ee7e00d6127c372e7a28bb27a80ef495cb2 (patch)
tree128c3fe2780f604f9eac5d7ff2292994ed2102f6 /core/chain_indexer_test.go
parente8752f4e9f9be3d2932cd4835a5d72d17ac2338b (diff)
downloadgo-tangerine-2cdf6ee7e00d6127c372e7a28bb27a80ef495cb2.tar
go-tangerine-2cdf6ee7e00d6127c372e7a28bb27a80ef495cb2.tar.gz
go-tangerine-2cdf6ee7e00d6127c372e7a28bb27a80ef495cb2.tar.bz2
go-tangerine-2cdf6ee7e00d6127c372e7a28bb27a80ef495cb2.tar.lz
go-tangerine-2cdf6ee7e00d6127c372e7a28bb27a80ef495cb2.tar.xz
go-tangerine-2cdf6ee7e00d6127c372e7a28bb27a80ef495cb2.tar.zst
go-tangerine-2cdf6ee7e00d6127c372e7a28bb27a80ef495cb2.zip
light: CHT and bloom trie indexers working in light mode (#16534)
This PR enables the indexers to work in light client mode by downloading a part of these tries (the Merkle proofs of the last values of the last known section) in order to be able to add new values and recalculate subsequent hashes. It also adds CHT data to NodeInfo.
Diffstat (limited to 'core/chain_indexer_test.go')
-rw-r--r--core/chain_indexer_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/chain_indexer_test.go b/core/chain_indexer_test.go
index 550caf556..a029dec62 100644
--- a/core/chain_indexer_test.go
+++ b/core/chain_indexer_test.go
@@ -17,6 +17,7 @@
package core
import (
+ "context"
"fmt"
"math/big"
"math/rand"
@@ -210,13 +211,13 @@ func (b *testChainIndexBackend) reorg(headNum uint64) uint64 {
return b.stored * b.indexer.sectionSize
}
-func (b *testChainIndexBackend) Reset(section uint64, prevHead common.Hash) error {
+func (b *testChainIndexBackend) Reset(ctx context.Context, section uint64, prevHead common.Hash) error {
b.section = section
b.headerCnt = 0
return nil
}
-func (b *testChainIndexBackend) Process(header *types.Header) {
+func (b *testChainIndexBackend) Process(ctx context.Context, header *types.Header) error {
b.headerCnt++
if b.headerCnt > b.indexer.sectionSize {
b.t.Error("Processing too many headers")
@@ -227,6 +228,7 @@ func (b *testChainIndexBackend) Process(header *types.Header) {
b.t.Fatal("Unexpected call to Process")
case b.processCh <- header.Number.Uint64():
}
+ return nil
}
func (b *testChainIndexBackend) Commit() error {