Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func LastStreamIdInvariant(k Keeper) sdk.Invariant
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func StreamerBalanceInvariant(k Keeper) sdk.Invariant
- func StreamsCountInvariant(k Keeper) sdk.Invariant
- func StreamsInvariant(k Keeper) sdk.Invariant
- type Hooks
- func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) error
- func (h Hooks) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, shareInAmount sdk.Int, ...)
- func (h Hooks) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, enterCoins sdk.Coins, ...)
- func (h Hooks) AfterPoolCreated(ctx sdk.Context, sender sdk.AccAddress, poolId uint64)
- func (h Hooks) AfterSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, input sdk.Coins, ...)
- func (h Hooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) error
- type Keeper
- func (k Keeper) ActiveStreamsIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) error
- func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) error
- func (k Keeper) CreatePoolGauge(ctx sdk.Context, poolId uint64) error
- func (k Keeper) CreateStream(ctx sdk.Context, coins sdk.Coins, records []types.DistrRecord, ...) (uint64, error)
- func (k Keeper) CreateStreamRefKeys(ctx sdk.Context, stream *types.Stream, combinedKeys []byte) error
- func (k Keeper) Distribute(ctx sdk.Context, streams []types.Stream) (sdk.Coins, error)
- func (k Keeper) DistributeByWeights(ctx sdk.Context, coins sdk.Coins, distrInfo *types.DistrInfo) (sdk.Coins, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) FinishedStreamsIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetActiveStreams(ctx sdk.Context) []types.Stream
- func (k Keeper) GetFinishedStreams(ctx sdk.Context) []types.Stream
- func (k Keeper) GetLastStreamID(ctx sdk.Context) uint64
- func (k Keeper) GetModuleDistributedCoins(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetModuleToDistributeCoins(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetNotFinishedStreams(ctx sdk.Context) []types.Stream
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetStreamByID(ctx sdk.Context, streamID uint64) (*types.Stream, error)
- func (k Keeper) GetStreamFromIDs(ctx sdk.Context, streamIDs []uint64) ([]types.Stream, error)
- func (k Keeper) GetStreams(ctx sdk.Context) []types.Stream
- func (k Keeper) GetUpcomingStreams(ctx sdk.Context) []types.Stream
- func (k Keeper) Hooks() Hooks
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) NewDistrInfo(ctx sdk.Context, records []types.DistrRecord) (*types.DistrInfo, error)
- func (k Keeper) ReplaceDistrRecords(ctx sdk.Context, streamId uint64, records []types.DistrRecord) error
- func (k Keeper) SetLastStreamID(ctx sdk.Context, ID uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetStreamWithRefKey(ctx sdk.Context, stream *types.Stream) error
- func (k Keeper) StreamsIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) TerminateStream(ctx sdk.Context, streamID uint64) error
- func (k Keeper) UpcomingStreamsIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) UpdateDistrRecords(ctx sdk.Context, streamId uint64, records []types.DistrRecord) error
- type Querier
- func (q Querier) ActiveStreams(goCtx context.Context, req *types.ActiveStreamsRequest) (*types.ActiveStreamsResponse, error)
- func (q Querier) ModuleToDistributeCoins(goCtx context.Context, _ *types.ModuleToDistributeCoinsRequest) (*types.ModuleToDistributeCoinsResponse, error)
- func (q Querier) StreamByID(goCtx context.Context, req *types.StreamByIDRequest) (*types.StreamByIDResponse, error)
- func (q Querier) Streams(goCtx context.Context, req *types.StreamsRequest) (*types.StreamsResponse, error)
- func (q Querier) UpcomingStreams(goCtx context.Context, req *types.UpcomingStreamsRequest) (*types.UpcomingStreamsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the x/streamer module.
func LastStreamIdInvariant ¶
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers the bank module invariants
func StreamsCountInvariant ¶
func StreamsInvariant ¶
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks is the wrapper struct for the streamer keeper.
func (Hooks) AfterEpochEnd ¶
AfterEpochEnd is the epoch end hook.
func (Hooks) AfterExitPool ¶
func (h Hooks) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, shareInAmount sdk.Int, exitCoins sdk.Coins)
AfterExitPool hook is a noop.
func (Hooks) AfterJoinPool ¶
func (h Hooks) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, enterCoins sdk.Coins, shareOutAmount sdk.Int)
AfterJoinPool hook is a noop.
func (Hooks) AfterPoolCreated ¶
AfterPoolCreated creates a gauge for each pool’s lockable duration.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper provides a way to manage streamer module storage.
func NewKeeper ¶
func NewKeeper(storeKey storetypes.StoreKey, paramSpace paramtypes.Subspace, bk types.BankKeeper, ek types.EpochKeeper, ak types.AccountKeeper, ik types.IncentivesKeeper) *Keeper
NewKeeper returns a new instance of the incentive module keeper struct.
func (Keeper) ActiveStreamsIterator ¶
ActiveStreamsIterator returns the iterator for all active streams.
func (Keeper) AfterEpochEnd ¶
AfterEpochEnd is the epoch end hook.
func (Keeper) BeforeEpochStart ¶
BeforeEpochStart is the epoch start hook.
func (Keeper) CreatePoolGauge ¶
func (Keeper) CreateStream ¶
func (k Keeper) CreateStream(ctx sdk.Context, coins sdk.Coins, records []types.DistrRecord, startTime time.Time, epochIdentifier string, numEpochsPaidOver uint64) (uint64, error)
CreateStream creates a stream and sends coins to the stream.
func (Keeper) CreateStreamRefKeys ¶
func (k Keeper) CreateStreamRefKeys(ctx sdk.Context, stream *types.Stream, combinedKeys []byte) error
CreateStreamRefKeys takes combinedKey (the keyPrefix for upcoming, active, or finished streams combined with stream start time) and adds a reference to the respective stream ID. If stream is active or upcoming, creates reference between the denom and stream ID. Used to consolidate codepaths for InitGenesis and CreateStream.
func (Keeper) Distribute ¶
Distribute distributes coins from an array of streams to all eligible locks.
func (Keeper) DistributeByWeights ¶
func (k Keeper) DistributeByWeights(ctx sdk.Context, coins sdk.Coins, distrInfo *types.DistrInfo) (sdk.Coins, error)
DistributeByWeights allocates and distributes coin according a gauge’s proportional weight that is recorded in the record.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the x/streamer module's exported genesis.
func (Keeper) FinishedStreamsIterator ¶
FinishedStreamsIterator returns the iterator for all finished streams.
func (Keeper) GetActiveStreams ¶
GetActiveStreams returns active streams.
func (Keeper) GetFinishedStreams ¶
GetFinishedStreams returns finished streams.
func (Keeper) GetLastStreamID ¶
GetLastStreamID returns the last used stream ID.
func (Keeper) GetModuleDistributedCoins ¶
GetModuleDistributedCoins returns sum of coins that have been distributed so far for all of the module.
func (Keeper) GetModuleToDistributeCoins ¶
GetModuleToDistributeCoins returns sum of coins yet to be distributed for all of the module.
func (Keeper) GetNotFinishedStreams ¶
GetNotFinishedStreams returns both upcoming and active streams.
func (Keeper) GetStreamByID ¶
GetStreamByID returns stream from stream ID.
func (Keeper) GetStreamFromIDs ¶
GetStreamFromIDs returns multiple streams from a streamIDs array.
func (Keeper) GetStreams ¶
GetStreams returns upcoming, active, and finished streams.
func (Keeper) GetUpcomingStreams ¶
GetUpcomingStreams returns upcoming streams.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
InitGenesis initializes the streamer module's state from a provided genesis state.
func (Keeper) NewDistrInfo ¶
func (Keeper) ReplaceDistrRecords ¶
func (k Keeper) ReplaceDistrRecords(ctx sdk.Context, streamId uint64, records []types.DistrRecord) error
This is checked for no err when a proposal is made, and executed when a proposal passes.
func (Keeper) SetLastStreamID ¶
SetLastStreamID sets the last used stream ID to the provided ID.
func (Keeper) SetStreamWithRefKey ¶
SetStreamWithRefKey takes a single stream and assigns a key. Takes combinedKey (the keyPrefix for upcoming, active, or finished streams combined with stream start time) and adds a reference to the respective stream ID.
func (Keeper) StreamsIterator ¶
StreamsIterator returns the iterator for all streams.
func (Keeper) TerminateStream ¶
TerminateStream cancels a stream.
func (Keeper) UpcomingStreamsIterator ¶
UpcomingStreamsIterator returns the iterator for all upcoming streams.
func (Keeper) UpdateDistrRecords ¶
func (k Keeper) UpdateDistrRecords(ctx sdk.Context, streamId uint64, records []types.DistrRecord) error
UpdateDistrRecords is checked for no err when a proposal is made, and executed when a proposal passes.
type Querier ¶
type Querier struct {
Keeper
}
Querier defines a wrapper around the streamer module keeper providing gRPC method handlers.
func (Querier) ActiveStreams ¶
func (q Querier) ActiveStreams(goCtx context.Context, req *types.ActiveStreamsRequest) (*types.ActiveStreamsResponse, error)
ActiveStreams returns all active streams.
func (Querier) ModuleToDistributeCoins ¶
func (q Querier) ModuleToDistributeCoins(goCtx context.Context, _ *types.ModuleToDistributeCoinsRequest) (*types.ModuleToDistributeCoinsResponse, error)
ModuleToDistributeCoins returns coins that are going to be distributed.
func (Querier) StreamByID ¶
func (q Querier) StreamByID(goCtx context.Context, req *types.StreamByIDRequest) (*types.StreamByIDResponse, error)
StreamByID takes a streamID and returns its respective stream.
func (Querier) Streams ¶
func (q Querier) Streams(goCtx context.Context, req *types.StreamsRequest) (*types.StreamsResponse, error)
Streams returns all upcoming and active streams.
func (Querier) UpcomingStreams ¶
func (q Querier) UpcomingStreams(goCtx context.Context, req *types.UpcomingStreamsRequest) (*types.UpcomingStreamsResponse, error)
UpcomingStreams returns all upcoming streams.