mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-11 05:20:05 +00:00
semi-fix graphql tests (compiles but 1 test fails)
This commit is contained in:
parent
162044fe10
commit
2caeb3c6bd
@ -35,7 +35,6 @@ import (
|
||||
"github.com/ledgerwatch/turbo-geth/core/vm"
|
||||
"github.com/ledgerwatch/turbo-geth/eth/filters"
|
||||
"github.com/ledgerwatch/turbo-geth/internal/ethapi"
|
||||
"github.com/ledgerwatch/turbo-geth/rlp"
|
||||
"github.com/ledgerwatch/turbo-geth/rpc"
|
||||
)
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
package graphql
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math/big"
|
||||
@ -29,6 +30,7 @@ import (
|
||||
"github.com/ledgerwatch/turbo-geth/core"
|
||||
"github.com/ledgerwatch/turbo-geth/eth"
|
||||
"github.com/ledgerwatch/turbo-geth/eth/ethconfig"
|
||||
"github.com/ledgerwatch/turbo-geth/ethdb"
|
||||
"github.com/ledgerwatch/turbo-geth/node"
|
||||
"github.com/ledgerwatch/turbo-geth/params"
|
||||
|
||||
@ -190,7 +192,7 @@ func createNode(t *testing.T, gqlEnabled bool) *node.Node {
|
||||
return stack
|
||||
}
|
||||
|
||||
func createGQLService(t *testing.T, stack *node.Node, endpoint string) { //nolint:unparam
|
||||
func createGQLService(t *testing.T, stack *node.Node) { //nolint:unparam
|
||||
// create backend
|
||||
ethConf := ðconfig.Config{
|
||||
Genesis: &core.Genesis{
|
||||
@ -201,7 +203,7 @@ func createGQLService(t *testing.T, stack *node.Node, endpoint string) { //nolin
|
||||
Ethash: ethash.Config{
|
||||
PowMode: ethash.ModeFake,
|
||||
},
|
||||
NetworkId: 1337,
|
||||
NetworkID: 1337,
|
||||
TrieCleanCache: 5,
|
||||
TrieCleanCacheJournal: "triecache",
|
||||
TrieCleanCacheRejournal: 60 * time.Minute,
|
||||
@ -214,9 +216,11 @@ func createGQLService(t *testing.T, stack *node.Node, endpoint string) { //nolin
|
||||
t.Fatalf("could not create eth backend: %v", err)
|
||||
}
|
||||
// Create some blocks and import them
|
||||
chain, _ := core.GenerateChain(params.AllEthashProtocolChanges, ethBackend.BlockChain().Genesis(),
|
||||
ethash.NewFaker(), ethBackend.ChainDb(), 10, func(i int, gen *core.BlockGen) {})
|
||||
_, err = ethBackend.BlockChain().InsertChain(chain)
|
||||
chain, _, _ := core.GenerateChain(
|
||||
params.AllEthashProtocolChanges,
|
||||
ethBackend.BlockChain().Genesis(),
|
||||
ethash.NewFaker(), ethBackend.ChainDb().(*ethdb.ObjectDatabase), 10, func(i int, gen *core.BlockGen) {}, false)
|
||||
_, err = ethBackend.BlockChain().InsertChain(context.TODO(), chain)
|
||||
if err != nil {
|
||||
t.Fatalf("could not create import blocks: %v", err)
|
||||
}
|
||||
|
@ -17,8 +17,10 @@
|
||||
package graphql
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/graph-gophers/graphql-go"
|
||||
"github.com/graph-gophers/graphql-go/relay"
|
||||
"github.com/ledgerwatch/turbo-geth/internal/ethapi"
|
||||
"github.com/ledgerwatch/turbo-geth/node"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user