keeper

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultParamspace = types.ModuleName
)

Variables

This section is empty.

Functions

func MakeTestCodec added in v0.2.0

func MakeTestCodec() *codec.Codec

func ParamKeyTable

func ParamKeyTable() params.KeyTable

func RandomNode added in v0.2.0

func RandomNode(r *rand.Rand, ctx sdk.Context, keeper Keeper) types.Node

func RandomSession added in v0.2.0

func RandomSession(r *rand.Rand, ctx sdk.Context, keeper Keeper) types.Session

func RandomSubscription added in v0.2.0

func RandomSubscription(r *rand.Rand, ctx sdk.Context, keeper Keeper) types.Subscription

Types

type Keeper

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

func CreateTestInput added in v0.2.0

func CreateTestInput(t *testing.T, isCheckTx bool) (sdk.Context, Keeper, deposit.Keeper, bank.Keeper)

func NewKeeper

func NewKeeper(cdc *codec.Codec, nodeKey, subscriptionKey, sessionKey sdk.StoreKey,
	paramStore params.Subspace, dk deposit.Keeper) Keeper

func (Keeper) AddDeposit

func (k Keeper) AddDeposit(ctx sdk.Context, address sdk.AccAddress, coin sdk.Coin) sdk.Error

func (Keeper) AddNodeIDToActiveList

func (k Keeper) AddNodeIDToActiveList(ctx sdk.Context, height int64, id hub.NodeID)

func (Keeper) AddSessionIDToActiveList

func (k Keeper) AddSessionIDToActiveList(ctx sdk.Context, height int64, id hub.SessionID)

func (Keeper) DeleteActiveNodeIDs

func (k Keeper) DeleteActiveNodeIDs(ctx sdk.Context, height int64)

func (Keeper) DeleteActiveSessionIDs

func (k Keeper) DeleteActiveSessionIDs(ctx sdk.Context, height int64)

func (Keeper) Deposit

func (k Keeper) Deposit(ctx sdk.Context) (res sdk.Coin)

func (Keeper) FreeNodesCount

func (k Keeper) FreeNodesCount(ctx sdk.Context) (res uint64)

func (Keeper) GetActiveNodeIDs

func (k Keeper) GetActiveNodeIDs(ctx sdk.Context, height int64) (ids hub.IDs)

func (Keeper) GetActiveSessionIDs

func (k Keeper) GetActiveSessionIDs(ctx sdk.Context, height int64) (ids hub.IDs)

func (Keeper) GetAllNodes

func (k Keeper) GetAllNodes(ctx sdk.Context) (nodes []types.Node)

func (Keeper) GetAllSessions

func (k Keeper) GetAllSessions(ctx sdk.Context) (sessions []types.Session)

func (Keeper) GetAllSubscriptions

func (k Keeper) GetAllSubscriptions(ctx sdk.Context) (subscriptions []types.Subscription)

func (Keeper) GetNode

func (k Keeper) GetNode(ctx sdk.Context, id hub.NodeID) (node types.Node, found bool)

func (Keeper) GetNodeIDByAddress

func (k Keeper) GetNodeIDByAddress(ctx sdk.Context, address sdk.AccAddress, i uint64) (id hub.NodeID, found bool)

func (Keeper) GetNodesCount

func (k Keeper) GetNodesCount(ctx sdk.Context) (count uint64)

func (Keeper) GetNodesCountOfAddress

func (k Keeper) GetNodesCountOfAddress(ctx sdk.Context, address sdk.AccAddress) (count uint64)

func (Keeper) GetNodesOfAddress

func (k Keeper) GetNodesOfAddress(ctx sdk.Context, address sdk.AccAddress) (nodes []types.Node)

func (Keeper) GetParams

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

func (Keeper) GetSession

func (k Keeper) GetSession(ctx sdk.Context, id hub.SessionID) (session types.Session, found bool)

func (Keeper) GetSessionIDBySubscriptionID

func (k Keeper) GetSessionIDBySubscriptionID(ctx sdk.Context,
	i hub.SubscriptionID, j uint64) (id hub.SessionID, found bool)

func (Keeper) GetSessionsCount

func (k Keeper) GetSessionsCount(ctx sdk.Context) (count uint64)

func (Keeper) GetSessionsCountOfSubscription

func (k Keeper) GetSessionsCountOfSubscription(ctx sdk.Context, id hub.SubscriptionID) (count uint64)

func (Keeper) GetSessionsOfSubscription

func (k Keeper) GetSessionsOfSubscription(ctx sdk.Context, id hub.SubscriptionID) (sessions []types.Session)

func (Keeper) GetSubscription

func (k Keeper) GetSubscription(ctx sdk.Context, id hub.SubscriptionID) (subscription types.Subscription, found bool)

func (Keeper) GetSubscriptionIDByAddress

func (k Keeper) GetSubscriptionIDByAddress(ctx sdk.Context,
	address sdk.AccAddress, i uint64) (id hub.SubscriptionID, found bool)

func (Keeper) GetSubscriptionIDByNodeID

func (k Keeper) GetSubscriptionIDByNodeID(ctx sdk.Context, i hub.NodeID, j uint64) (id hub.SubscriptionID, found bool)

func (Keeper) GetSubscriptionsCount

func (k Keeper) GetSubscriptionsCount(ctx sdk.Context) (count uint64)

func (Keeper) GetSubscriptionsCountOfAddress

func (k Keeper) GetSubscriptionsCountOfAddress(ctx sdk.Context, address sdk.AccAddress) (count uint64)

func (Keeper) GetSubscriptionsCountOfNode

func (k Keeper) GetSubscriptionsCountOfNode(ctx sdk.Context, id hub.NodeID) (count uint64)

func (Keeper) GetSubscriptionsOfAddress

func (k Keeper) GetSubscriptionsOfAddress(ctx sdk.Context,
	address sdk.AccAddress) (subscriptions []types.Subscription)

func (Keeper) GetSubscriptionsOfNode

func (k Keeper) GetSubscriptionsOfNode(ctx sdk.Context, id hub.NodeID) (subscriptions []types.Subscription)

func (Keeper) IterateNodes

func (k Keeper) IterateNodes(ctx sdk.Context, fn func(index int64, node types.Node) (stop bool))

func (Keeper) IterateSubscriptions

func (k Keeper) IterateSubscriptions(ctx sdk.Context,
	fn func(index int64, subscription types.Subscription) (stop bool))

func (Keeper) RemoveNodeIDFromActiveList

func (k Keeper) RemoveNodeIDFromActiveList(ctx sdk.Context, height int64, id hub.NodeID)

func (Keeper) RemoveSessionIDFromActiveList

func (k Keeper) RemoveSessionIDFromActiveList(ctx sdk.Context, height int64, id hub.SessionID)

func (Keeper) SendDeposit

func (k Keeper) SendDeposit(ctx sdk.Context, from, toAddress sdk.AccAddress, coin sdk.Coin) sdk.Error

func (Keeper) SessionInactiveInterval

func (k Keeper) SessionInactiveInterval(ctx sdk.Context) (res int64)

func (Keeper) SetActiveNodeIDs

func (k Keeper) SetActiveNodeIDs(ctx sdk.Context, height int64, ids hub.IDs)

func (Keeper) SetActiveSessionIDs

func (k Keeper) SetActiveSessionIDs(ctx sdk.Context, height int64, ids hub.IDs)

func (Keeper) SetNode

func (k Keeper) SetNode(ctx sdk.Context, node types.Node)

func (Keeper) SetNodeIDByAddress

func (k Keeper) SetNodeIDByAddress(ctx sdk.Context, address sdk.AccAddress, i uint64, id hub.NodeID)

func (Keeper) SetNodesCount

func (k Keeper) SetNodesCount(ctx sdk.Context, count uint64)

func (Keeper) SetNodesCountOfAddress

func (k Keeper) SetNodesCountOfAddress(ctx sdk.Context, address sdk.AccAddress, count uint64)

func (Keeper) SetParams

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

func (Keeper) SetSession

func (k Keeper) SetSession(ctx sdk.Context, session types.Session)

func (Keeper) SetSessionIDBySubscriptionID

func (k Keeper) SetSessionIDBySubscriptionID(ctx sdk.Context, i hub.SubscriptionID, j uint64, id hub.SessionID)

func (Keeper) SetSessionsCount

func (k Keeper) SetSessionsCount(ctx sdk.Context, count uint64)

func (Keeper) SetSessionsCountOfSubscription

func (k Keeper) SetSessionsCountOfSubscription(ctx sdk.Context, id hub.SubscriptionID, count uint64)

func (Keeper) SetSubscription

func (k Keeper) SetSubscription(ctx sdk.Context, subscription types.Subscription)

func (Keeper) SetSubscriptionIDByAddress

func (k Keeper) SetSubscriptionIDByAddress(ctx sdk.Context, address sdk.AccAddress, i uint64, id hub.SubscriptionID)

func (Keeper) SetSubscriptionIDByNodeID

func (k Keeper) SetSubscriptionIDByNodeID(ctx sdk.Context, i hub.NodeID, j uint64, id hub.SubscriptionID)

func (Keeper) SetSubscriptionsCount

func (k Keeper) SetSubscriptionsCount(ctx sdk.Context, count uint64)

func (Keeper) SetSubscriptionsCountOfAddress

func (k Keeper) SetSubscriptionsCountOfAddress(ctx sdk.Context, address sdk.AccAddress, count uint64)

func (Keeper) SetSubscriptionsCountOfNode

func (k Keeper) SetSubscriptionsCountOfNode(ctx sdk.Context, id hub.NodeID, count uint64)

func (Keeper) SubtractDeposit

func (k Keeper) SubtractDeposit(ctx sdk.Context, address sdk.AccAddress, coin sdk.Coin) sdk.Error

Jump to

Keyboard shortcuts

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