types

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 30 Imported by: 2

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// ModuleName defines the module name
	ModuleName = "session"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// MemStoreKey defines the in-memory store key
	MemStoreKey = "mem_session"
)
View Source
const (
	// BlockHashKeyPrefix is the prefix to retrieve all BlockHash
	BlockHashKeyPrefix = "BlockHash/height/"
)

Variables

View Source
var (
	ErrSessionInvalidSigner          = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message")
	ErrSessionHydration              = sdkerrors.Register(ModuleName, 1101, "error during session hydration")
	ErrSessionAppNotFound            = sdkerrors.Register(ModuleName, 1102, "application for session not found not found ")
	ErrSessionAppNotStakedForService = sdkerrors.Register(ModuleName, 1103, "application in session not staked for requested service")
	ErrSessionSuppliersNotFound      = sdkerrors.Register(ModuleName, 1104, "no suppliers not found for session")
	ErrSessionInvalidAppAddress      = sdkerrors.Register(ModuleName, 1105, "invalid application address for session")
	ErrSessionInvalidService         = sdkerrors.Register(ModuleName, 1106, "invalid service in session")
	ErrSessionInvalidBlockHeight     = sdkerrors.Register(ModuleName, 1107, "invalid block height for session")
	ErrSessionInvalidSessionId       = sdkerrors.Register(ModuleName, 1108, "invalid sessionId")
)

x/session module sentinel errors

View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthParams        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowParams          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthSession        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSession          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSession = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ParamsKey = []byte("p_session")

Functions

func BlockHashKey

func BlockHashKey(blockHeight int64) []byte

BlockHashKey returns the store key to retrieve a BlockHash from the index fields

func KeyPrefix

func KeyPrefix(p string) []byte

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable the param key table for launch module

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

func RegisterMsgServer added in v0.0.3

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler added in v0.0.3

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient added in v0.0.3

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint added in v0.0.3

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer added in v0.0.3

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer added in v0.0.3

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // only used for simulation
}

AccountKeeper defines the expected account keeper used for simulations (noalias)

type ApplicationKeeper

type ApplicationKeeper interface {
	GetApplication(ctx context.Context, address string) (app apptypes.Application, found bool)
}

ApplicationKeeper defines the expected application keeper to retrieve applications

type BankKeeper

type BankKeeper interface {
	SpendableCoins(context.Context, sdk.AccAddress) sdk.Coins
}

BankKeeper defines the expected interface needed to retrieve account balances.

type GenesisState added in v0.0.3

type GenesisState struct {
	// params defines all the parameters of the module.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

GenesisState defines the session module's genesis state.

func DefaultGenesis added in v0.0.3

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default genesis state

func (*GenesisState) Descriptor added in v0.0.3

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetParams added in v0.0.3

func (m *GenesisState) GetParams() Params

func (*GenesisState) Marshal added in v0.0.3

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo added in v0.0.3

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer added in v0.0.3

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage added in v0.0.3

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset added in v0.0.3

func (m *GenesisState) Reset()

func (*GenesisState) Size added in v0.0.3

func (m *GenesisState) Size() (n int)

func (*GenesisState) String added in v0.0.3

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal added in v0.0.3

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) Validate added in v0.0.3

func (gs GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure.

func (*GenesisState) XXX_DiscardUnknown added in v0.0.3

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal added in v0.0.3

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge added in v0.0.3

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size added in v0.0.3

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal added in v0.0.3

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type MsgClient added in v0.0.3

type MsgClient interface {
	// UpdateParams defines a (governance) operation for updating the module
	// parameters. The authority defaults to the x/gov module account.
	UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient added in v0.0.3

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgServer added in v0.0.3

type MsgServer interface {
	// UpdateParams defines a (governance) operation for updating the module
	// parameters. The authority defaults to the x/gov module account.
	UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
}

MsgServer is the server API for Msg service.

type MsgUpdateParams added in v0.0.3

type MsgUpdateParams struct {
	// authority is the address that controls the module (defaults to x/gov unless overwritten).
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// params defines the x/session parameters to update.
	// NOTE: All parameters must be supplied.
	Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
}

MsgUpdateParams is the Msg/UpdateParams request type.

func (*MsgUpdateParams) Descriptor added in v0.0.3

func (*MsgUpdateParams) Descriptor() ([]byte, []int)

func (*MsgUpdateParams) GetAuthority added in v0.0.3

func (m *MsgUpdateParams) GetAuthority() string

func (*MsgUpdateParams) GetParams added in v0.0.3

func (m *MsgUpdateParams) GetParams() Params

func (*MsgUpdateParams) Marshal added in v0.0.3

func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error)

func (*MsgUpdateParams) MarshalTo added in v0.0.3

func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error)

func (*MsgUpdateParams) MarshalToSizedBuffer added in v0.0.3

func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgUpdateParams) ProtoMessage added in v0.0.3

func (*MsgUpdateParams) ProtoMessage()

func (*MsgUpdateParams) Reset added in v0.0.3

func (m *MsgUpdateParams) Reset()

func (*MsgUpdateParams) Size added in v0.0.3

func (m *MsgUpdateParams) Size() (n int)

func (*MsgUpdateParams) String added in v0.0.3

func (m *MsgUpdateParams) String() string

func (*MsgUpdateParams) Unmarshal added in v0.0.3

func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error

func (*MsgUpdateParams) ValidateBasic added in v0.0.3

func (m *MsgUpdateParams) ValidateBasic() error

ValidateBasic does a sanity check on the provided data.

func (*MsgUpdateParams) XXX_DiscardUnknown added in v0.0.3

func (m *MsgUpdateParams) XXX_DiscardUnknown()

func (*MsgUpdateParams) XXX_Marshal added in v0.0.3

func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgUpdateParams) XXX_Merge added in v0.0.3

func (m *MsgUpdateParams) XXX_Merge(src proto.Message)

func (*MsgUpdateParams) XXX_Size added in v0.0.3

func (m *MsgUpdateParams) XXX_Size() int

func (*MsgUpdateParams) XXX_Unmarshal added in v0.0.3

func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error

type MsgUpdateParamsResponse added in v0.0.3

type MsgUpdateParamsResponse struct {
}

MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message.

func (*MsgUpdateParamsResponse) Descriptor added in v0.0.3

func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int)

func (*MsgUpdateParamsResponse) Marshal added in v0.0.3

func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error)

func (*MsgUpdateParamsResponse) MarshalTo added in v0.0.3

func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgUpdateParamsResponse) MarshalToSizedBuffer added in v0.0.3

func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgUpdateParamsResponse) ProtoMessage added in v0.0.3

func (*MsgUpdateParamsResponse) ProtoMessage()

func (*MsgUpdateParamsResponse) Reset added in v0.0.3

func (m *MsgUpdateParamsResponse) Reset()

func (*MsgUpdateParamsResponse) Size added in v0.0.3

func (m *MsgUpdateParamsResponse) Size() (n int)

func (*MsgUpdateParamsResponse) String added in v0.0.3

func (m *MsgUpdateParamsResponse) String() string

func (*MsgUpdateParamsResponse) Unmarshal added in v0.0.3

func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error

func (*MsgUpdateParamsResponse) XXX_DiscardUnknown added in v0.0.3

func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown()

func (*MsgUpdateParamsResponse) XXX_Marshal added in v0.0.3

func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgUpdateParamsResponse) XXX_Merge added in v0.0.3

func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message)

func (*MsgUpdateParamsResponse) XXX_Size added in v0.0.3

func (m *MsgUpdateParamsResponse) XXX_Size() int

func (*MsgUpdateParamsResponse) XXX_Unmarshal added in v0.0.3

func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error

type Params added in v0.0.3

type Params struct {
}

Params defines the parameters for the module.

func DefaultParams added in v0.0.3

func DefaultParams() Params

DefaultParams returns a default set of parameters

func NewParams added in v0.0.3

func NewParams() Params

NewParams creates a new Params instance

func (*Params) Descriptor added in v0.0.3

func (*Params) Descriptor() ([]byte, []int)

func (*Params) Equal added in v0.0.3

func (this *Params) Equal(that interface{}) bool

func (*Params) Marshal added in v0.0.3

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo added in v0.0.3

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer added in v0.0.3

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs added in v0.0.3

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs get the params.ParamSet

func (*Params) ProtoMessage added in v0.0.3

func (*Params) ProtoMessage()

func (*Params) Reset added in v0.0.3

func (m *Params) Reset()

func (*Params) Size added in v0.0.3

func (m *Params) Size() (n int)

func (*Params) String added in v0.0.3

func (m *Params) String() string

func (*Params) Unmarshal added in v0.0.3

func (m *Params) Unmarshal(dAtA []byte) error

func (Params) ValidateBasic added in v0.0.3

func (p Params) ValidateBasic() error

ValidateBasic does a sanity check on the provided params.

func (*Params) XXX_DiscardUnknown added in v0.0.3

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal added in v0.0.3

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge added in v0.0.3

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size added in v0.0.3

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal added in v0.0.3

func (m *Params) XXX_Unmarshal(b []byte) error

type QueryClient added in v0.0.3

type QueryClient interface {
	// Parameters queries the parameters of the module.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	// Queries the session given app_address, service and block_height.
	GetSession(ctx context.Context, in *QueryGetSessionRequest, opts ...grpc.CallOption) (*QueryGetSessionResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient added in v0.0.3

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryGetSessionRequest added in v0.0.3

type QueryGetSessionRequest struct {
	ApplicationAddress string         `protobuf:"bytes,1,opt,name=application_address,json=applicationAddress,proto3" json:"application_address,omitempty"`
	Service            *types.Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
	BlockHeight        int64          `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
}

func NewQueryGetSessionRequest added in v0.0.3

func NewQueryGetSessionRequest(appAddress, serviceId string, blockHeight int64) *QueryGetSessionRequest

NOTE: Please note that `QueryGetSessionRequest` is not a `sdk.Msg`, and is therefore not a message/request that will be signable or invoke a state transition. However, following a similar `ValidateBasic` pattern allows us to localize & reuse validation logic.

func (*QueryGetSessionRequest) Descriptor added in v0.0.3

func (*QueryGetSessionRequest) Descriptor() ([]byte, []int)

func (*QueryGetSessionRequest) GetApplicationAddress added in v0.0.3

func (m *QueryGetSessionRequest) GetApplicationAddress() string

func (*QueryGetSessionRequest) GetBlockHeight added in v0.0.3

func (m *QueryGetSessionRequest) GetBlockHeight() int64

func (*QueryGetSessionRequest) GetService added in v0.0.3

func (m *QueryGetSessionRequest) GetService() *types.Service

func (*QueryGetSessionRequest) Marshal added in v0.0.3

func (m *QueryGetSessionRequest) Marshal() (dAtA []byte, err error)

func (*QueryGetSessionRequest) MarshalTo added in v0.0.3

func (m *QueryGetSessionRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryGetSessionRequest) MarshalToSizedBuffer added in v0.0.3

func (m *QueryGetSessionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryGetSessionRequest) ProtoMessage added in v0.0.3

func (*QueryGetSessionRequest) ProtoMessage()

func (*QueryGetSessionRequest) Reset added in v0.0.3

func (m *QueryGetSessionRequest) Reset()

func (*QueryGetSessionRequest) Size added in v0.0.3

func (m *QueryGetSessionRequest) Size() (n int)

func (*QueryGetSessionRequest) String added in v0.0.3

func (m *QueryGetSessionRequest) String() string

func (*QueryGetSessionRequest) Unmarshal added in v0.0.3

func (m *QueryGetSessionRequest) Unmarshal(dAtA []byte) error

func (*QueryGetSessionRequest) ValidateBasic added in v0.0.3

func (query *QueryGetSessionRequest) ValidateBasic() error

func (*QueryGetSessionRequest) XXX_DiscardUnknown added in v0.0.3

func (m *QueryGetSessionRequest) XXX_DiscardUnknown()

func (*QueryGetSessionRequest) XXX_Marshal added in v0.0.3

func (m *QueryGetSessionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryGetSessionRequest) XXX_Merge added in v0.0.3

func (m *QueryGetSessionRequest) XXX_Merge(src proto.Message)

func (*QueryGetSessionRequest) XXX_Size added in v0.0.3

func (m *QueryGetSessionRequest) XXX_Size() int

func (*QueryGetSessionRequest) XXX_Unmarshal added in v0.0.3

func (m *QueryGetSessionRequest) XXX_Unmarshal(b []byte) error

type QueryGetSessionResponse added in v0.0.3

type QueryGetSessionResponse struct {
	Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"`
}

func (*QueryGetSessionResponse) Descriptor added in v0.0.3

func (*QueryGetSessionResponse) Descriptor() ([]byte, []int)

func (*QueryGetSessionResponse) GetSession added in v0.0.3

func (m *QueryGetSessionResponse) GetSession() *Session

func (*QueryGetSessionResponse) Marshal added in v0.0.3

func (m *QueryGetSessionResponse) Marshal() (dAtA []byte, err error)

func (*QueryGetSessionResponse) MarshalTo added in v0.0.3

func (m *QueryGetSessionResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryGetSessionResponse) MarshalToSizedBuffer added in v0.0.3

func (m *QueryGetSessionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryGetSessionResponse) ProtoMessage added in v0.0.3

func (*QueryGetSessionResponse) ProtoMessage()

func (*QueryGetSessionResponse) Reset added in v0.0.3

func (m *QueryGetSessionResponse) Reset()

func (*QueryGetSessionResponse) Size added in v0.0.3

func (m *QueryGetSessionResponse) Size() (n int)

func (*QueryGetSessionResponse) String added in v0.0.3

func (m *QueryGetSessionResponse) String() string

func (*QueryGetSessionResponse) Unmarshal added in v0.0.3

func (m *QueryGetSessionResponse) Unmarshal(dAtA []byte) error

func (*QueryGetSessionResponse) XXX_DiscardUnknown added in v0.0.3

func (m *QueryGetSessionResponse) XXX_DiscardUnknown()

func (*QueryGetSessionResponse) XXX_Marshal added in v0.0.3

func (m *QueryGetSessionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryGetSessionResponse) XXX_Merge added in v0.0.3

func (m *QueryGetSessionResponse) XXX_Merge(src proto.Message)

func (*QueryGetSessionResponse) XXX_Size added in v0.0.3

func (m *QueryGetSessionResponse) XXX_Size() int

func (*QueryGetSessionResponse) XXX_Unmarshal added in v0.0.3

func (m *QueryGetSessionResponse) XXX_Unmarshal(b []byte) error

type QueryParamsRequest added in v0.0.3

type QueryParamsRequest struct {
}

QueryParamsRequest is request type for the Query/Params RPC method.

func (*QueryParamsRequest) Descriptor added in v0.0.3

func (*QueryParamsRequest) Descriptor() ([]byte, []int)

func (*QueryParamsRequest) Marshal added in v0.0.3

func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)

func (*QueryParamsRequest) MarshalTo added in v0.0.3

func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsRequest) MarshalToSizedBuffer added in v0.0.3

func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsRequest) ProtoMessage added in v0.0.3

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset added in v0.0.3

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size added in v0.0.3

func (m *QueryParamsRequest) Size() (n int)

func (*QueryParamsRequest) String added in v0.0.3

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal added in v0.0.3

func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error

func (*QueryParamsRequest) XXX_DiscardUnknown added in v0.0.3

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal added in v0.0.3

func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsRequest) XXX_Merge added in v0.0.3

func (m *QueryParamsRequest) XXX_Merge(src proto.Message)

func (*QueryParamsRequest) XXX_Size added in v0.0.3

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal added in v0.0.3

func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error

type QueryParamsResponse added in v0.0.3

type QueryParamsResponse struct {
	// params holds all the parameters of this module.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryParamsResponse is response type for the Query/Params RPC method.

func (*QueryParamsResponse) Descriptor added in v0.0.3

func (*QueryParamsResponse) Descriptor() ([]byte, []int)

func (*QueryParamsResponse) GetParams added in v0.0.3

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal added in v0.0.3

func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)

func (*QueryParamsResponse) MarshalTo added in v0.0.3

func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsResponse) MarshalToSizedBuffer added in v0.0.3

func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsResponse) ProtoMessage added in v0.0.3

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset added in v0.0.3

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size added in v0.0.3

func (m *QueryParamsResponse) Size() (n int)

func (*QueryParamsResponse) String added in v0.0.3

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal added in v0.0.3

func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error

func (*QueryParamsResponse) XXX_DiscardUnknown added in v0.0.3

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal added in v0.0.3

func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsResponse) XXX_Merge added in v0.0.3

func (m *QueryParamsResponse) XXX_Merge(src proto.Message)

func (*QueryParamsResponse) XXX_Size added in v0.0.3

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal added in v0.0.3

func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error

type QueryServer added in v0.0.3

type QueryServer interface {
	// Parameters queries the parameters of the module.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	// Queries the session given app_address, service and block_height.
	GetSession(context.Context, *QueryGetSessionRequest) (*QueryGetSessionResponse, error)
}

QueryServer is the server API for Query service.

type Session added in v0.0.3

type Session struct {
	Header              *SessionHeader      `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	SessionId           string              `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	SessionNumber       int64               `protobuf:"varint,3,opt,name=session_number,json=sessionNumber,proto3" json:"session_number,omitempty"`
	NumBlocksPerSession int64               `protobuf:"varint,4,opt,name=num_blocks_per_session,json=numBlocksPerSession,proto3" json:"num_blocks_per_session,omitempty"`
	Application         *types1.Application `protobuf:"bytes,5,opt,name=application,proto3" json:"application,omitempty"`
	Suppliers           []*types.Supplier   `protobuf:"bytes,6,rep,name=suppliers,proto3" json:"suppliers,omitempty"`
}

Session is a fully hydrated session object that contains all the information for the Session and its parcipants.

func (*Session) Descriptor added in v0.0.3

func (*Session) Descriptor() ([]byte, []int)

func (*Session) GetApplication added in v0.0.3

func (m *Session) GetApplication() *types1.Application

func (*Session) GetHeader added in v0.0.3

func (m *Session) GetHeader() *SessionHeader

func (*Session) GetNumBlocksPerSession added in v0.0.3

func (m *Session) GetNumBlocksPerSession() int64

func (*Session) GetSessionId added in v0.0.3

func (m *Session) GetSessionId() string

func (*Session) GetSessionNumber added in v0.0.3

func (m *Session) GetSessionNumber() int64

func (*Session) GetSuppliers added in v0.0.3

func (m *Session) GetSuppliers() []*types.Supplier

func (*Session) Marshal added in v0.0.3

func (m *Session) Marshal() (dAtA []byte, err error)

func (*Session) MarshalTo added in v0.0.3

func (m *Session) MarshalTo(dAtA []byte) (int, error)

func (*Session) MarshalToSizedBuffer added in v0.0.3

func (m *Session) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Session) ProtoMessage added in v0.0.3

func (*Session) ProtoMessage()

func (*Session) Reset added in v0.0.3

func (m *Session) Reset()

func (*Session) Size added in v0.0.3

func (m *Session) Size() (n int)

func (*Session) String added in v0.0.3

func (m *Session) String() string

func (*Session) Unmarshal added in v0.0.3

func (m *Session) Unmarshal(dAtA []byte) error

func (*Session) XXX_DiscardUnknown added in v0.0.3

func (m *Session) XXX_DiscardUnknown()

func (*Session) XXX_Marshal added in v0.0.3

func (m *Session) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Session) XXX_Merge added in v0.0.3

func (m *Session) XXX_Merge(src proto.Message)

func (*Session) XXX_Size added in v0.0.3

func (m *Session) XXX_Size() int

func (*Session) XXX_Unmarshal added in v0.0.3

func (m *Session) XXX_Unmarshal(b []byte) error

type SessionHeader added in v0.0.3

type SessionHeader struct {
	ApplicationAddress string         `protobuf:"bytes,1,opt,name=application_address,json=applicationAddress,proto3" json:"application_address,omitempty"`
	Service            *types.Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
	// NOTE: session_id can be derived from the above values using on-chain but is included in the header for convenience
	SessionId               string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	SessionStartBlockHeight int64  `` /* 135-byte string literal not displayed */
	// Note that`session_end_block_height` is a derivative of (`start` + `num_blocks_per_session`)
	// as goverened by on-chain params at the time of the session start.
	// It is stored as an additional field to simplofy business logic in case
	// the number of blocks_per_session changes during the session.
	SessionEndBlockHeight int64 `` /* 129-byte string literal not displayed */
}

SessionHeader is a lightweight header for a session that can be passed around. It is the minimal amount of data required to hydrate & retrieve all data relevant to the session.

func (*SessionHeader) Descriptor added in v0.0.3

func (*SessionHeader) Descriptor() ([]byte, []int)

func (*SessionHeader) GetApplicationAddress added in v0.0.3

func (m *SessionHeader) GetApplicationAddress() string

func (*SessionHeader) GetService added in v0.0.3

func (m *SessionHeader) GetService() *types.Service

func (*SessionHeader) GetSessionEndBlockHeight added in v0.0.3

func (m *SessionHeader) GetSessionEndBlockHeight() int64

func (*SessionHeader) GetSessionId added in v0.0.3

func (m *SessionHeader) GetSessionId() string

func (*SessionHeader) GetSessionStartBlockHeight added in v0.0.3

func (m *SessionHeader) GetSessionStartBlockHeight() int64

func (*SessionHeader) Marshal added in v0.0.3

func (m *SessionHeader) Marshal() (dAtA []byte, err error)

func (*SessionHeader) MarshalTo added in v0.0.3

func (m *SessionHeader) MarshalTo(dAtA []byte) (int, error)

func (*SessionHeader) MarshalToSizedBuffer added in v0.0.3

func (m *SessionHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SessionHeader) ProtoMessage added in v0.0.3

func (*SessionHeader) ProtoMessage()

func (*SessionHeader) Reset added in v0.0.3

func (m *SessionHeader) Reset()

func (*SessionHeader) Size added in v0.0.3

func (m *SessionHeader) Size() (n int)

func (*SessionHeader) String added in v0.0.3

func (m *SessionHeader) String() string

func (*SessionHeader) Unmarshal added in v0.0.3

func (m *SessionHeader) Unmarshal(dAtA []byte) error

func (*SessionHeader) ValidateBasic added in v0.0.3

func (sh *SessionHeader) ValidateBasic() error

TODO_BETA: Ensure this is used everywhere a SessionHeader is validated. ValidateBasic performs basic stateless validation of a SessionHeader.

func (*SessionHeader) XXX_DiscardUnknown added in v0.0.3

func (m *SessionHeader) XXX_DiscardUnknown()

func (*SessionHeader) XXX_Marshal added in v0.0.3

func (m *SessionHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SessionHeader) XXX_Merge added in v0.0.3

func (m *SessionHeader) XXX_Merge(src proto.Message)

func (*SessionHeader) XXX_Size added in v0.0.3

func (m *SessionHeader) XXX_Size() int

func (*SessionHeader) XXX_Unmarshal added in v0.0.3

func (m *SessionHeader) XXX_Unmarshal(b []byte) error

type SharedKeeper added in v0.0.3

type SharedKeeper interface {
	GetParams(ctx context.Context) (params sharedtypes.Params)
}

SharedKeeper defines the expected interface needed to retrieve shared parameters

type SupplierKeeper

type SupplierKeeper interface {
	GetAllSuppliers(ctx context.Context) (suppliers []sharedtypes.Supplier)
}

SupplierKeeper defines the expected interface needed to retrieve suppliers

type UnimplementedMsgServer added in v0.0.3

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) UpdateParams added in v0.0.3

type UnimplementedQueryServer added in v0.0.3

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) GetSession added in v0.0.3

func (*UnimplementedQueryServer) Params added in v0.0.3

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL