Documentation ¶
Index ¶
- func AssertStatusErrorWithCode(t *testing.T, err error, code codes.Code)
- func DisableLogging() (reset func())
- func GenerateSolanaKeypair(t *testing.T) ed25519.PrivateKey
- func GenerateSolanaKeys(t *testing.T, n int) []ed25519.PublicKey
- func NewRandomAccount(t *testing.T) *common.Account
- func SetupRandomSubsidizer(t *testing.T, data code_data.Provider) *common.Account
- func WaitFor(timeout, interval time.Duration, condition func() bool) error
- type Server
- type ServerOption
- func WithStreamClientInterceptor(i grpc.StreamClientInterceptor) ServerOption
- func WithStreamServerInterceptor(i grpc.StreamServerInterceptor) ServerOption
- func WithUnaryClientInterceptor(i grpc.UnaryClientInterceptor) ServerOption
- func WithUnaryServerInterceptor(i grpc.UnaryServerInterceptor) ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertStatusErrorWithCode ¶
AssertStatusErrorWithCode verifies that the provided error is a gRPC status error of the provided status code.
func DisableLogging ¶
func DisableLogging() (reset func())
func GenerateSolanaKeypair ¶
func GenerateSolanaKeypair(t *testing.T) ed25519.PrivateKey
func SetupRandomSubsidizer ¶
Types ¶
type Server ¶
Server provides a local gRPC server with basic interceptors that can be used for testing with no external dependencies.
func NewServer ¶
func NewServer(opts ...ServerOption) (*grpc.ClientConn, *Server, error)
NewServer creates a new Server.
func (*Server) RegisterService ¶
RegisterService registers a gRPC service with Server.
type ServerOption ¶
type ServerOption func(o *serverOpts)
ServerOption configures the settings when creating a test server.
func WithStreamClientInterceptor ¶
func WithStreamClientInterceptor(i grpc.StreamClientInterceptor) ServerOption
WithStreamClientInterceptor adds a stream client interceptor to the test client.
func WithStreamServerInterceptor ¶
func WithStreamServerInterceptor(i grpc.StreamServerInterceptor) ServerOption
WithStreamServerInterceptor adds a stream server interceptor to the test client.
func WithUnaryClientInterceptor ¶
func WithUnaryClientInterceptor(i grpc.UnaryClientInterceptor) ServerOption
WithUnaryClientInterceptor adds a unary client interceptor to the test client.
func WithUnaryServerInterceptor ¶
func WithUnaryServerInterceptor(i grpc.UnaryServerInterceptor) ServerOption
WithUnaryServerInterceptor adds a unary server interceptor to the test client.