keeper

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllInvariants

func AllInvariants(keeper Keeper) sdk.Invariant

AllInvariants runs all invariants of the stream module

func ModuleAccountInvariant

func ModuleAccountInvariant(k Keeper) sdk.Invariant

ModuleAccountInvariant checks that the module account coins reflects the sum of total stream deposits held in the store

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)

RegisterInvariants registers all stream invariants

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	storeKey storetypes.StoreKey,
	bankKeeper types.BankKeeper,
	accKeeper types.AccountKeeper,
	cdc codec.BinaryCodec,
	feeCollectorName string,
	authority string,
) Keeper

func (Keeper) AddDeposit

func (k Keeper) AddDeposit(ctx sdk.Context, receiverAddr, senderAddr sdk.AccAddress, topUpDeposit sdk.Coin) (bool, error)

func (Keeper) CancelStreamBySenderReceiver

func (k Keeper) CancelStreamBySenderReceiver(ctx sdk.Context, receiverAddr, senderAddr sdk.AccAddress) error

func (Keeper) Cdc

func (k Keeper) Cdc() codec.BinaryCodec

func (Keeper) ClaimFromStream

func (k Keeper) ClaimFromStream(ctx sdk.Context, receiverAddr, senderAddr sdk.AccAddress) (sdk.Coin, sdk.Coin, sdk.Coin, sdk.Coin, error)

func (Keeper) CreateNewStream

func (k Keeper) CreateNewStream(ctx sdk.Context, receiverAddr, senderAddr sdk.AccAddress, deposit sdk.Coin, flowRate int64) (types.Stream, error)

CreateNewStream creates a new "empty" stream for a sender/receiver pair. Deposit and Deposit Zero Time are handled by the AddDeposit function. The value passed in the deposit var is only used to determine the denomination of the deposit.

func (Keeper) DeleteStream

func (k Keeper) DeleteStream(ctx sdk.Context, receiverAddr, senderAddr sdk.AccAddress)

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns the module's exported genesis

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the x/stream module's authority.

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the total set of x/stream parameters.

func (Keeper) GetStream

func (k Keeper) GetStream(ctx sdk.Context, receiverAddr, senderAddr sdk.AccAddress) (types.Stream, bool)

GetStream Gets the stream data

func (Keeper) GetStreamModuleAccount

func (k Keeper) GetStreamModuleAccount(ctx sdk.Context) authtypes.ModuleAccountI

GetStreamModuleAccount returns the stream ModuleAccount

func (Keeper) GetStreamModuleAccountBalances

func (k Keeper) GetStreamModuleAccountBalances(ctx sdk.Context) sdk.Coins

GetStreamModuleAccountBalances returns the stream ModuleAccount's balances from the bank keeper

func (Keeper) GetTotalDeposits

func (k Keeper) GetTotalDeposits(ctx sdk.Context) sdk.Coins

GetTotalDeposits gets the total deposits - just a wrapper for getting the module account's balances from the bank

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)

InitGenesis initializes the module's state from a provided genesis state.

func (Keeper) IsStream

func (k Keeper) IsStream(ctx sdk.Context, receiverAddr, senderAddr sdk.AccAddress) bool

IsStream Checks if the stream is present in the store or not

func (Keeper) IterateAllStreams

func (k Keeper) IterateAllStreams(ctx sdk.Context, cb func(sdk.AccAddress, sdk.AccAddress, types.Stream) bool)

IterateAllStreams iterates over all the Streams of all accounts that are provided to a callback. If true is returned from the callback, iteration is halted. Potentially expensive, and only intended for use during genesis export etc.

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) Params

func (Keeper) SetNewFlowRate

func (k Keeper) SetNewFlowRate(ctx sdk.Context, receiverAddr, senderAddr sdk.AccAddress, newFlowRate int64) error

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error

SetParams sets the total set of x/stream parameters.

func (Keeper) SetStream

func (k Keeper) SetStream(ctx sdk.Context, receiverAddr, senderAddr sdk.AccAddress, stream types.Stream) error

SetStream Sets the stream

Jump to

Keyboard shortcuts

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