Documentation ¶
Index ¶
- Variables
- func IsPastGracePeriod(sessionEndBlockHeight, currentBlockHeight int64) bool
- func IsWithinGracePeriod(sessionEndBlockHeight, currentBlockHeight int64) bool
- func NewRelayerSessions(ctx context.Context, deps depinject.Config, ...) (_ relayer.RelayerSessionsManager, err error)
- func NewSessionTree(sessionHeader *sessiontypes.SessionHeader, storesDirectory string, ...) (relayer.SessionTree, error)
- func WithStoresDirectory(storesDirectory string) relayer.RelayerSessionsManagerOption
Constants ¶
This section is empty.
Variables ¶
var ( ErrSessionTreeClosed = sdkerrors.Register(codespace, 1, "session tree already closed") ErrSessionTreeNotClosed = sdkerrors.Register(codespace, 2, "session tree not closed") ErrSessionTreeStorePathExists = sdkerrors.Register(codespace, 3, "session tree store path already exists") ErrSessionTreeProofPathMismatch = sdkerrors.Register(codespace, 4, "session tree proof path mismatch") ErrSessionTreeUndefinedStoresDirectory = sdkerrors.Register(codespace, 5, "session tree key-value store directory undefined for where they will be saved on disk") ErrSessionTreeAlreadyMarkedAsClaimed = sdkerrors.Register(codespace, 6, "session tree already marked as claimed") )
Functions ¶
func IsPastGracePeriod ¶ added in v0.0.2
IsPastGracePeriod checks if the grace period for the session, given its end block height, has ended.
func IsWithinGracePeriod ¶
IsWithinGracePeriod checks if the grace period for the session has ended and signals whether it is time to create a claim for it.
func NewRelayerSessions ¶
func NewRelayerSessions( ctx context.Context, deps depinject.Config, opts ...relayer.RelayerSessionsManagerOption, ) (_ relayer.RelayerSessionsManager, err error)
NewRelayerSessions creates a new relayerSessions.
Required dependencies:
- client.BlockClient
- client.SupplierClient
Available options:
- WithStoresDirectory
func NewSessionTree ¶
func NewSessionTree( sessionHeader *sessiontypes.SessionHeader, storesDirectory string, removeFromRelayerSessions func(sessionHeader *sessiontypes.SessionHeader), ) (relayer.SessionTree, error)
NewSessionTree creates a new sessionTree from a Session and a storePrefix. It also takes a function removeFromRelayerSessions that removes the sessionTree from the RelayerSessionsManager. It returns an error if the KVStore fails to be created.
func WithStoresDirectory ¶
func WithStoresDirectory(storesDirectory string) relayer.RelayerSessionsManagerOption
WithStoresDirectory sets the path on disk where KVStore data files used to store SMST of work sessions are created.
Types ¶
This section is empty.