Documentation
¶
Index ¶
- func AssertStatusErrorWithCode(t *testing.T, err error, code codes.Code)
- func NewRandomAccount(t *testing.T) *common.Account
- func NewRandomVmConfig(t *testing.T, isCore bool) *common.VmConfig
- func SetupLaunchpadCurrency(t *testing.T, data ocp_data.Provider, reserveStore reserve.Store, ...) *common.Account
- func SetupLaunchpadCurrencyInState(t *testing.T, data ocp_data.Provider, reserveStore reserve.Store, ...) *common.Account
- func SetupRandomSubsidizer(t *testing.T, data ocp_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 SetupLaunchpadCurrency ¶ added in v1.3.0
func SetupLaunchpadCurrency(t *testing.T, data ocp_data.Provider, reserveStore reserve.Store, holderStore holder.Store) *common.Account
SetupLaunchpadCurrency creates a random non-core VM config and all data records needed for a launchpad currency to be fully functional: currency metadata (Available), VM metadata (Available), authority private key in vault, and a live reserve record.
func SetupLaunchpadCurrencyInState ¶ added in v1.30.0
func SetupLaunchpadCurrencyInState(t *testing.T, data ocp_data.Provider, reserveStore reserve.Store, holderStore holder.Store, state currency.MetadataState, createdBy *common.Account) *common.Account
SetupLaunchpadCurrencyInState is SetupLaunchpadCurrency for a currency in the provided state and created by the provided owner, which are fixed once the metadata is saved. Program addresses are derived as the Launch RPC derives them, so clients can rebuild currency creation transactions.
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(log *zap.Logger, 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.