graphqltestgen

command module
v0.0.0-...-0d57be9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2023 License: GPL-3.0 Imports: 22 Imported by: 0

README

graphqltestgen

This is a tool to help generate tests for the Hive GraphQL simulator. The main function is to extend a chain of blocks by writing Go code for the new blocks. For this the genesis and a RLP-encoded list of files should be provided which can be found in the GraphQL test suite. E.g. if you run:

go run . --genesis genesis.json --chain chain.rlp

it will produce the new chain in newchain.rlp. Note that genesis.json and chain.rlp are the default values so those flags can be skipped.

It's possible to view the latest block of the chain with:

go run . --genesis genesis.json --chain chain.rlp head

Filling tests

When adding a new test case it's useful to run the query against a real node to fetch the response. This can be done with the fill command as follows:

go run . --genesis genesis.json --chain chain.rlp fill --request request.gql --bin /path/to/geth

The response will be written to response.gql.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL