keeper

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanContract

func CanContract(ctx sdk.Context, root string, creator string, k Keeper) error

func MakeCid

func MakeCid(data []byte) (string, error)

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey sdk.StoreKey,
	ps paramtypes.Subspace,
	bankkeeper types.BankKeeper,
	accountkeeper types.AccountKeeper,
	oraclekeeper types.OracleKeeper,
) *Keeper

func (Keeper) FidCid

func (Keeper) FindFile

func (Keeper) Freespace

func (Keeper) GetActiveDeals

func (k Keeper) GetActiveDeals(
	ctx sdk.Context,
	cid string,
) (val types.ActiveDeals, found bool)

GetActiveDeals returns a activeDeals from its index

func (Keeper) GetAllActiveDeals

func (k Keeper) GetAllActiveDeals(ctx sdk.Context) (list []types.ActiveDeals)

GetAllActiveDeals returns all activeDeals

func (Keeper) GetAllContracts

func (k Keeper) GetAllContracts(ctx sdk.Context) (list []types.Contracts)

GetAllContracts returns all contracts

func (Keeper) GetAllFidCid

func (k Keeper) GetAllFidCid(ctx sdk.Context) (list []types.FidCid)

GetAllFidCid returns all fidCid

func (Keeper) GetAllProviders

func (k Keeper) GetAllProviders(ctx sdk.Context) (list []types.Providers)

GetAllProviders returns all providers

func (Keeper) GetAllStoragePaymentInfo

func (k Keeper) GetAllStoragePaymentInfo(ctx sdk.Context) (list []types.StoragePaymentInfo)

GetAllStoragePaymentInfo returns all payBlocks

func (Keeper) GetAllStrays

func (k Keeper) GetAllStrays(ctx sdk.Context) (list []types.Strays)

GetAllStrays returns all strays

func (Keeper) GetContracts

func (k Keeper) GetContracts(
	ctx sdk.Context,
	cid string,
) (val types.Contracts, found bool)

GetContracts returns a contracts from its index

func (Keeper) GetFidCid

func (k Keeper) GetFidCid(
	ctx sdk.Context,
	fid string,
) (val types.FidCid, found bool)

GetFidCid returns a fidCid from its index

func (Keeper) GetJklPrice

func (k Keeper) GetJklPrice(ctx sdk.Context) (price sdk.Dec)

GetJklPrice uses oracle module to get jkl price Returns 0.20 if feed doesn't exist or failed to unmarshal data Unmarshal failure is logged

func (Keeper) GetPaidAmount

func (k Keeper) GetPaidAmount(ctx sdk.Context, address string) int64

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetPayData

func (Keeper) GetProviderDeals added in v1.2.2

func (k Keeper) GetProviderDeals(ctx sdk.Context, provider string) int64

func (Keeper) GetProviderUsing

func (k Keeper) GetProviderUsing(ctx sdk.Context, provider string) int64

func (Keeper) GetProviders

func (k Keeper) GetProviders(
	ctx sdk.Context,
	address string,
) (val types.Providers, found bool)

GetProviders returns a providers from its index

func (Keeper) GetStorageCost

func (k Keeper) GetStorageCost(ctx sdk.Context, gbs int64, hours int64) sdk.Int

GetStorageCost calculates storage cost in ujkl Uses gigabytes and months to calculate how much user has to pay

func (Keeper) GetStoragePaymentInfo

func (k Keeper) GetStoragePaymentInfo(
	ctx sdk.Context,
	address string,
) (val types.StoragePaymentInfo, found bool)

GetStoragePaymentInfo returns StoragePaymentInfo from its address

func (Keeper) GetStrays

func (k Keeper) GetStrays(
	ctx sdk.Context,
	cid string,
) (val types.Strays, found bool)

GetStrays returns a strays from its index

func (Keeper) HandleRewardBlock

func (k Keeper) HandleRewardBlock(ctx sdk.Context) error

func (Keeper) InternalRewards

func (k Keeper) InternalRewards(ctx sdk.Context, allDeals []types.ActiveDeals, address sdk.AccAddress) error

func (Keeper) KillOldContracts

func (k Keeper) KillOldContracts(ctx sdk.Context)

func (Keeper) ListFiles

func (k Keeper) ListFiles(ctx sdk.Context, fid string) []string

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) RemoveActiveDeals

func (k Keeper) RemoveActiveDeals(
	ctx sdk.Context,
	cid string,
)

RemoveActiveDeals removes a activeDeals from the store

func (Keeper) RemoveContracts

func (k Keeper) RemoveContracts(
	ctx sdk.Context,
	cid string,
)

RemoveContracts removes a contracts from the store

func (Keeper) RemoveFidCid

func (k Keeper) RemoveFidCid(
	ctx sdk.Context,
	fid string,
)

RemoveFidCid removes a fidCid from the store

func (Keeper) RemoveProviders

func (k Keeper) RemoveProviders(
	ctx sdk.Context,
	address string,
)

RemoveProviders removes a providers from the store

func (Keeper) RemoveStoragePaymentInfo

func (k Keeper) RemoveStoragePaymentInfo(
	ctx sdk.Context,
	address string,
)

RemoveStoragePaymentInfo removes a StoragePaymentInfo from the store

func (Keeper) RemoveStrays

func (k Keeper) RemoveStrays(
	ctx sdk.Context,
	cid string,
)

RemoveStrays removes a strays from the store

func (Keeper) SetActiveDeals

func (k Keeper) SetActiveDeals(ctx sdk.Context, activeDeals types.ActiveDeals)

SetActiveDeals set a specific activeDeals in the store from its index

func (Keeper) SetContracts

func (k Keeper) SetContracts(ctx sdk.Context, contracts types.Contracts)

SetContracts set a specific contracts in the store from its index

func (Keeper) SetFidCid

func (k Keeper) SetFidCid(ctx sdk.Context, fidCid types.FidCid)

SetFidCid set a specific fidCid in the store from its index

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetProviders

func (k Keeper) SetProviders(ctx sdk.Context, providers types.Providers)

SetProviders set a specific providers in the store from its index

func (Keeper) SetStoragePaymentInfo

func (k Keeper) SetStoragePaymentInfo(ctx sdk.Context, payInfo types.StoragePaymentInfo)

SetStoragePaymentInfo set a specific payBlocks in the store from its x

func (Keeper) SetStrays

func (k Keeper) SetStrays(ctx sdk.Context, strays types.Strays)

SetStrays set a specific strays in the store from its index

func (Keeper) StoreCount added in v1.2.2

func (Keeper) Strays

func (Keeper) UpgradeStorage

type Migrator

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator

func (Migrator) Migrate1to2

func (m Migrator) Migrate1to2(ctx sdk.Context) error

Migrate1to2 migrates from version 1 to 2.

func (Migrator) Migrate2to3

func (m Migrator) Migrate2to3(ctx sdk.Context) error

Migrate2to3 migrates from version 2 to 3.

func (Migrator) Migrate3to4

func (m Migrator) Migrate3to4(ctx sdk.Context) error

Migrate3to4 migrates from version 3 to 4.

Jump to

Keyboard shortcuts

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