Documentation ¶
Index ¶
- Variables
- func Head(val interface{}) *evmtypes.Head
- func NewAddress() common.Address
- func NewEthClientMock(t *testing.T) *evmclmocks.Client
- func NewEthClientMockWithDefaultChain(t *testing.T) *evmclmocks.Client
- func NewLegacyTransaction(nonce uint64, to common.Address, value *big.Int, gasLimit uint32, ...) *types.Transaction
- func NewRandomEVMChainID() *big.Int
- func NewTestChainScopedConfig(t testing.TB, overrideFn func(c *toml.EVMConfig)) config.ChainScopedConfig
- func NewWSServer(t *testing.T, chainID *big.Int, callback JSONRPCHandler) (ts *testWSServer)
- func WSServerURL(t *testing.T, s *httptest.Server) *url.URL
- type Awaiter
- type JSONRPCHandler
- type JSONRPCResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var FixtureChainID = big.NewInt(0)
FixtureChainID matches the chain always added by fixtures.sql It is set to 0 since no real chain ever has this ID and allows a virtual "test" chain ID to be used without clashes
View Source
var SimulatedChainID = big.NewInt(1337)
SimulatedChainID is the chain ID for the go-ethereum simulated backend
Functions ¶
func NewEthClientMock ¶
func NewEthClientMock(t *testing.T) *evmclmocks.Client
func NewEthClientMockWithDefaultChain ¶
func NewEthClientMockWithDefaultChain(t *testing.T) *evmclmocks.Client
func NewLegacyTransaction ¶
func NewRandomEVMChainID ¶
NewRandomEVMChainID returns a suitable random chain ID that will not conflict with fixtures
func NewWSServer ¶
func NewWSServer(t *testing.T, chainID *big.Int, callback JSONRPCHandler) (ts *testWSServer)
NewWSServer starts a websocket server which invokes callback for each message received. If chainID is set, then eth_chainId calls will be automatically handled.
Types ¶
type Awaiter ¶
type Awaiter chan struct{}
func NewAwaiter ¶
func NewAwaiter() Awaiter
func (Awaiter) AwaitOrFail ¶
func (Awaiter) ItHappened ¶
func (a Awaiter) ItHappened()
type JSONRPCHandler ¶
type JSONRPCHandler func(reqMethod string, reqParams gjson.Result) JSONRPCResponse
JSONRPCHandler is called with the method and request param(s). respResult will be sent immediately. notifyResult is optional, and sent after a short delay.
type JSONRPCResponse ¶
Click to show internal directories.
Click to hide internal directories.