rpctestgen

command module
v0.0.0-...-360df75 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: MIT Imports: 28 Imported by: 0

README

rpctestgen

rpctestgen is a test fixture generator for the execution layer JSON-RPC API.

Conceptually, it is similar to retesteth, in that it 1) takes test definitions, 2) executes them against a client, and 3) outputs the exchange.

The full API specification can be found in ethereum/exeuction-apis.

Usage

rpctestgen runs with sane defaults. The tests will be filled with whatever binary geth matches in the $PATH. For a full list of options, see rpctestgen --help.

Quick Start

To fill all tests, simply run make fill.

$ make fill
go build .
./rpctestgen
starting client
filling tests...
generating tests/eth_blockNumber/simple-test.io  done.
generating tests/eth_getBlockByNumber/get-genesis.io  done.
generating tests/eth_getBlockByNumber/get-block-n.io  done.

This will write the generated test fixtures to tests/ directory. In addition to JSON-RPC exchange, a chain.rlp and genesis.json will be included so that the exchange can be verified on all clients.

Fixture format

The fixtures are very simple. Each statement is delimited by a newline. The >> prefix denotes a request sent to the client. The << prefix denotes the client's response.

>> {"jsonrpc":"2.0","id":1,"method":"eth_blockNumber"}
<< {"jsonrpc":"2.0","id":1,"result":"0x3"}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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