Documentation ¶
Overview ¶
Package mock is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ProxyHandler = jsonrpc.DefaultRWHandler( jsonrpc.HandlerFunc(func(rw jsonrpc.ResponseWriter, msg *jsonrpc.RequestMsg) { resp, err := SessionFromContext(msg.Context()).ClientRPC().Do(msg) if err != nil { _ = jsonrpc.WriteError(rw, err) } else { _ = rw.WriteMsg(resp) } }), )
Functions ¶
Types ¶
type Config ¶
type Config struct { RPC *DownstreamConfig `json:"rpc,omitempty" yaml:"rpc,omitempty"` PrivTxManager *DownstreamConfig `json:"tessera,omitempty" yaml:"tessera,omitempty"` }
Config is the cfg format for a Hashicorp Vault secret store
func (*Config) SetDefault ¶
type DownstreamConfig ¶
type DownstreamConfig struct { Addr string `json:"addr" yaml:"addr" validate:"required" example:"http://geth:8545"` Transport *transport.Config `json:"transport,omitempty" yaml:"transport,omitempty"` Proxy *ProxyConfig `json:"proxy,omitempty" yaml:"proxy,omitempty"` ClientTimeout *json.Duration `json:"clientTimeout,omitempty" yaml:"client_timeout,omitempty"` }
func (*DownstreamConfig) SetDefault ¶
func (cfg *DownstreamConfig) SetDefault() *DownstreamConfig
type MockSession ¶
type MockSession struct {
// contains filtered or unexported fields
}
MockSession is a mock of Session interface.
func NewMockSession ¶
func NewMockSession(ctrl *gomock.Controller) *MockSession
NewMockSession creates a new mock instance.
func (*MockSession) ClientPrivTxManager ¶
func (m *MockSession) ClientPrivTxManager() tessera.Client
ClientPrivTxManager mock base method.
func (*MockSession) ClientRPC ¶
func (m *MockSession) ClientRPC() jsonrpc.Client
ClientRPC mock base method.
func (*MockSession) EXPECT ¶
func (m *MockSession) EXPECT() *MockSessionMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSession) EthCaller ¶
func (m *MockSession) EthCaller() ethereum.Caller
EthCaller mock base method.
type MockSessionMockRecorder ¶
type MockSessionMockRecorder struct {
// contains filtered or unexported fields
}
MockSessionMockRecorder is the mock recorder for MockSession.
func (*MockSessionMockRecorder) ClientPrivTxManager ¶
func (mr *MockSessionMockRecorder) ClientPrivTxManager() *gomock.Call
ClientPrivTxManager indicates an expected call of ClientPrivTxManager.
func (*MockSessionMockRecorder) ClientRPC ¶
func (mr *MockSessionMockRecorder) ClientRPC() *gomock.Call
ClientRPC indicates an expected call of ClientRPC.
func (*MockSessionMockRecorder) EthCaller ¶
func (mr *MockSessionMockRecorder) EthCaller() *gomock.Call
EthCaller indicates an expected call of EthCaller.
type Node ¶
type Node struct { // Handler is the JSON-RPC handler Handler jsonrpc.Handler // contains filtered or unexported fields }
Node is a node connected to JSON-RPC downstream and a Tessera downstream allowing to intercept proxy JSON-RPC
type ProxyConfig ¶
type ProxyConfig struct { Request *request.ProxyConfig `json:"request,omitempty" yaml:"request,omitempty"` Response *response.ProxyConfig `json:"response,omitempty" yaml:"response,omitempty"` WebSocket *websocket.ProxyConfig `json:"websocket,omitempty" yaml:"websocket,omitempty"` }
func (*ProxyConfig) SetDefault ¶
func (cfg *ProxyConfig) SetDefault() *ProxyConfig
type Session ¶
type Session interface { // ClientRPC returns a client to downstream JSON-RPC ClientRPC() jsonrpc.Client // EthCaller returns a caller to downstream Ethereum JSON-RPC EthCaller() ethereum.Caller // ClientPrivTxManager returns client to downstream private transaction manager ClientPrivTxManager() tessera.Client }
Session holds client interface to a downstream node