aboutsummaryrefslogtreecommitdiffstats
path: root/light/odr_test.go
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2018-08-28 15:08:16 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-08-28 15:08:16 +0800
commitb69476b372a26679e5bdb33db3d508f2c955e7ff (patch)
tree47757ef2b65302f19aca96327b7a34ad73f652a5 /light/odr_test.go
parentc64d72bea207ccaca3f6aded25d8730a4b8696cd (diff)
downloadgo-tangerine-b69476b372a26679e5bdb33db3d508f2c955e7ff.tar
go-tangerine-b69476b372a26679e5bdb33db3d508f2c955e7ff.tar.gz
go-tangerine-b69476b372a26679e5bdb33db3d508f2c955e7ff.tar.bz2
go-tangerine-b69476b372a26679e5bdb33db3d508f2c955e7ff.tar.lz
go-tangerine-b69476b372a26679e5bdb33db3d508f2c955e7ff.tar.xz
go-tangerine-b69476b372a26679e5bdb33db3d508f2c955e7ff.tar.zst
go-tangerine-b69476b372a26679e5bdb33db3d508f2c955e7ff.zip
all: make indexer configurable (#17188)
Diffstat (limited to 'light/odr_test.go')
-rw-r--r--light/odr_test.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/light/odr_test.go b/light/odr_test.go
index 3e7ac1011..eea5b1eab 100644
--- a/light/odr_test.go
+++ b/light/odr_test.go
@@ -55,8 +55,9 @@ var (
type testOdr struct {
OdrBackend
- sdb, ldb ethdb.Database
- disable bool
+ indexerConfig *IndexerConfig
+ sdb, ldb ethdb.Database
+ disable bool
}
func (odr *testOdr) Database() ethdb.Database {
@@ -92,6 +93,10 @@ func (odr *testOdr) Retrieve(ctx context.Context, req OdrRequest) error {
return nil
}
+func (odr *testOdr) IndexerConfig() *IndexerConfig {
+ return odr.indexerConfig
+}
+
type odrTestFn func(ctx context.Context, db ethdb.Database, bc *core.BlockChain, lc *LightChain, bhash common.Hash) ([]byte, error)
func TestOdrGetBlockLes1(t *testing.T) { testChainOdr(t, 1, odrGetBlock) }
@@ -258,7 +263,7 @@ func testChainOdr(t *testing.T, protocol int, fn odrTestFn) {
t.Fatal(err)
}
- odr := &testOdr{sdb: sdb, ldb: ldb}
+ odr := &testOdr{sdb: sdb, ldb: ldb, indexerConfig: TestClientIndexerConfig}
lightchain, err := NewLightChain(odr, params.TestChainConfig, ethash.NewFullFaker())
if err != nil {
t.Fatal(err)