keeper

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountAddressPrefix = "st"
)
View Source
const QueryVolumeReport = "volume_report"

Variables

View Source
var (
	AccountPubKeyPrefix    = AccountAddressPrefix + "pub"
	ValidatorAddressPrefix = AccountAddressPrefix + "valoper"
	ValidatorPubKeyPrefix  = AccountAddressPrefix + "valoperpub"
	ConsNodeAddressPrefix  = AccountAddressPrefix + "valcons"
	ConsNodePubKeyPrefix   = AccountAddressPrefix + "valconspub"
)

Functions

func MakeTestCodec

func MakeTestCodec() *codec.Codec

create a codec used only for testing

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

NewQuerier creates a new querier for pot clients.

func SetConfig

func SetConfig()

Types

type Keeper

type Keeper struct {
	BankKeeper     bank.Keeper
	SupplyKeeper   supply.Keeper
	AccountKeeper  auth.AccountKeeper
	StakingKeeper  staking.Keeper
	RegisterKeeper register.Keeper
	// contains filtered or unexported fields
}

Keeper of the pot store

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, paramSpace params.Subspace, feeCollectorName string,
	bankKeeper bank.Keeper, supplyKeeper supply.Keeper, accountKeeper auth.AccountKeeper, stakingKeeper staking.Keeper,
	registerKeeper register.Keeper,
) Keeper

NewKeeper creates a pot keeper

func (Keeper) BondDenom

func (k Keeper) BondDenom(ctx sdk.Context) (res string)

BondDenom - Bondable coin denomination

func (Keeper) CalcMiningRewardInTotal

func (k Keeper) CalcMiningRewardInTotal(ctx sdk.Context, distributeGoal types.DistributeGoal) (types.DistributeGoal, error)

allocate mining reward from foundation account

func (Keeper) CalcRewardForIndexingNode

func (k Keeper) CalcRewardForIndexingNode(ctx sdk.Context, distributeGoal types.DistributeGoal, rewardDetailMap map[string]types.Reward,
) (map[string]types.Reward, types.DistributeGoal)

func (Keeper) CalcRewardForResourceNode

func (k Keeper) CalcRewardForResourceNode(ctx sdk.Context, trafficList []types.SingleNodeVolume,
	distributeGoal types.DistributeGoal, rewardDetailMap map[string]types.Reward,
) (map[string]types.Reward, types.DistributeGoal)

func (Keeper) CalcTrafficRewardInTotal

func (k Keeper) CalcTrafficRewardInTotal(
	ctx sdk.Context, trafficList []types.SingleNodeVolume, distributeGoal types.DistributeGoal,
) (types.DistributeGoal, error)

func (Keeper) DeleteVolumeReport

func (k Keeper) DeleteVolumeReport(ctx sdk.Context, key []byte)

func (Keeper) DistributePotReward

func (k Keeper) DistributePotReward(ctx sdk.Context, trafficList []types.SingleNodeVolume, epoch sdk.Int) (err error)

func (Keeper) GetFoundationAccount

func (k Keeper) GetFoundationAccount(ctx sdk.Context) (acc sdk.AccAddress)

func (Keeper) GetImmatureTotalReward

func (k Keeper) GetImmatureTotalReward(ctx sdk.Context, acc sdk.AccAddress) (value sdk.Int)

func (Keeper) GetIndividualReward

func (k Keeper) GetIndividualReward(ctx sdk.Context, acc sdk.AccAddress, epoch sdk.Int) (value sdk.Int)

func (Keeper) GetInitialUOzonePrice

func (k Keeper) GetInitialUOzonePrice(ctx sdk.Context) (price sdk.Int)

func (Keeper) GetMatureTotalReward

func (k Keeper) GetMatureTotalReward(ctx sdk.Context, acc sdk.AccAddress) (value sdk.Int)

func (Keeper) GetMinedTokens

func (k Keeper) GetMinedTokens(ctx sdk.Context, epoch sdk.Int) (minedToken sdk.Int)

func (Keeper) GetMiningRewardParamByMinedToken

func (k Keeper) GetMiningRewardParamByMinedToken(ctx sdk.Context, minedToken sdk.Int) (types.MiningRewardParam, error)

func (Keeper) GetParams

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

GetParams returns the total set of pot parameters.

func (Keeper) GetRewardAddressPool

func (k Keeper) GetRewardAddressPool(ctx sdk.Context) (addressList []sdk.AccAddress)

func (Keeper) GetTotalConsumedOzone

func (k Keeper) GetTotalConsumedOzone(trafficList []types.SingleNodeVolume) sdk.Int

func (Keeper) GetTotalMinedTokens

func (k Keeper) GetTotalMinedTokens(ctx sdk.Context) (totalMinedToken sdk.Int)

func (Keeper) GetTotalUnissuedPrepay

func (k Keeper) GetTotalUnissuedPrepay(ctx sdk.Context) (totalUnissuedPrepay sdk.Int)

func (Keeper) GetVolumeReport

func (k Keeper) GetVolumeReport(ctx sdk.Context, reporter sdk.AccAddress) ([]byte, error)

GetVolumeReport returns the hash of volume report

func (Keeper) IsSPNode

func (k Keeper) IsSPNode(ctx sdk.Context, addr sdk.AccAddress) (found bool)

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) MatureEpoch

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

func (Keeper) MiningRewardParams

func (k Keeper) MiningRewardParams(ctx sdk.Context) (res []types.MiningRewardParam)

func (Keeper) SetFoundationAccount

func (k Keeper) SetFoundationAccount(ctx sdk.Context, acc sdk.AccAddress)

func (Keeper) SetInitialUOzonePrice

func (k Keeper) SetInitialUOzonePrice(ctx sdk.Context, price sdk.Int)

func (Keeper) SetParams

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

SetParams sets the pot parameters to the param space.

func (Keeper) SetTotalUnissuedPrepay

func (k Keeper) SetTotalUnissuedPrepay(ctx sdk.Context, totalUnissuedPrepay sdk.Int)

func (Keeper) SetVolumeReport

func (k Keeper) SetVolumeReport(ctx sdk.Context, reporter sdk.AccAddress, reportReference string)

func (Keeper) Withdraw

func (k Keeper) Withdraw(ctx sdk.Context, amount sdk.Coin, nodeAddress sdk.AccAddress, ownerAddress sdk.AccAddress) error

Jump to

Keyboard shortcuts

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