Documentation ¶
Overview ¶
Package rpctest provides utilities for testing RPC methods.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a fake RPC endpoint that responds only to a single requests that is definded in a golden-file.
Request golden-files have the following format to define a single request and the corresponding response:
// Comments and empty lines will be ignored. // Request starts with ">". > {"jsonrpc":"2.0","id":1,"method":"eth_chainId"} // Response starts with "<". < {"jsonrpc":"2.0","id":1,"result":"0x1"}
func NewFileServer ¶
NewFileServer returns a new instance of Server that serves the golden-file from the given filename.
Click to show internal directories.
Click to hide internal directories.