Documentation ¶
Index ¶
- Constants
- func MakeTestCodec() *codec.Codec
- func NewQuerier(k Keeper) sdk.Querier
- func TestMain(m *testing.M)
- type Keeper
- func (k Keeper) BondDenom(ctx sdk.Context) (res string)
- func (k Keeper) CalcMiningRewardInTotal(ctx sdk.Context, distributeGoal types.DistributeGoal) (types.DistributeGoal, error)
- func (k Keeper) CalcMiningRewardInTotalForTestnet(ctx sdk.Context, distributeGoal types.DistributeGoal) (types.DistributeGoal, []regtypes.IndexingNode, []regtypes.ResourceNode, error)
- func (k Keeper) CalcRewardForIndexingNode(ctx sdk.Context, distributeGoal types.DistributeGoal, ...) (map[string]types.Reward, types.DistributeGoal)
- func (k Keeper) CalcRewardForIndexingNodeForTestnet(ctx sdk.Context, distributeGoal types.DistributeGoal, ...) (map[string]types.Reward, types.DistributeGoal)
- func (k Keeper) CalcRewardForResourceNode(ctx sdk.Context, trafficList []types.SingleWalletVolume, ...) (map[string]types.Reward, types.DistributeGoal)
- func (k Keeper) CalcRewardForResourceNodeForTestnet(ctx sdk.Context, trafficList []types.SingleWalletVolume, ...) (map[string]types.Reward, types.DistributeGoal)
- func (k Keeper) CalcTrafficRewardInTotal(ctx sdk.Context, trafficList []types.SingleWalletVolume, ...) (sdk.Dec, types.DistributeGoal, error)
- func (k Keeper) DistributePotReward(ctx sdk.Context, trafficList []types.SingleWalletVolume, epoch sdk.Int) (totalConsumedOzone sdk.Dec, err error)
- func (k Keeper) DistributePotRewardForTestnet(ctx sdk.Context, trafficList []types.SingleWalletVolume, epoch sdk.Int) (totalConsumedOzone sdk.Dec, err error)
- func (k Keeper) FoundationDeposit(ctx sdk.Context, amount sdk.Coins, from sdk.AccAddress) (err error)
- func (k Keeper) GetImmatureTotalReward(ctx sdk.Context, walletAddress sdk.AccAddress) (value sdk.Coins)
- func (k Keeper) GetIndividualReward(ctx sdk.Context, walletAddress sdk.AccAddress, epoch sdk.Int) (value types.Reward, found bool)
- func (k Keeper) GetLastReportedEpoch(ctx sdk.Context) (epoch sdk.Int)
- func (k Keeper) GetMatureTotalReward(ctx sdk.Context, walletAddress sdk.AccAddress) (value sdk.Coins)
- func (k Keeper) GetMinedTokens(ctx sdk.Context, epoch sdk.Int) (minedToken sdk.Coin)
- func (k Keeper) GetMiningRewardParamByMinedToken(ctx sdk.Context, minedToken sdk.Coin) (types.MiningRewardParam, error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetTotalConsumedUoz(trafficList []types.SingleWalletVolume) sdk.Int
- func (k Keeper) GetTotalMinedTokens(ctx sdk.Context) (totalMinedToken sdk.Coin)
- func (k Keeper) GetTrafficReward(ctx sdk.Context, trafficList []types.SingleWalletVolume) (totalConsumedOzone, result sdk.Dec)
- func (k Keeper) GetVolumeReport(ctx sdk.Context, epoch sdk.Int) (res types.VolumeReportRecord)
- func (k Keeper) IsSPNode(ctx sdk.Context, p2pAddr stratos.SdsAddress) (found bool)
- func (k Keeper) IteratorImmatureTotal(ctx sdk.Context, ...)
- func (k Keeper) IteratorIndividualReward(ctx sdk.Context, epoch sdk.Int, ...)
- func (k Keeper) IteratorMatureTotal(ctx sdk.Context, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MatureEpoch(ctx sdk.Context) (res int64)
- func (k Keeper) MiningRewardParams(ctx sdk.Context) (res []types.MiningRewardParam)
- func (k Keeper) RewardDenom(ctx sdk.Context) (res string)
- func (k Keeper) SetImmatureTotalReward(ctx sdk.Context, walletAddress sdk.AccAddress, value sdk.Coins)
- func (k Keeper) SetIndividualReward(ctx sdk.Context, walletAddress sdk.AccAddress, epoch sdk.Int, ...)
- func (k Keeper) SetLastReportedEpoch(ctx sdk.Context, epoch sdk.Int)
- func (k Keeper) SetMatureTotalReward(ctx sdk.Context, walletAddress sdk.AccAddress, value sdk.Coins)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetTotalMinedTokens(ctx sdk.Context, totalMinedToken sdk.Coin)
- func (k Keeper) SetVolumeReport(ctx sdk.Context, epoch sdk.Int, reportRecord types.VolumeReportRecord)
- func (k Keeper) SlashingResourceNode(ctx sdk.Context, p2pAddr stratos.SdsAddress, walletAddr sdk.AccAddress, ...) (amt sdk.Int, nodeType regtypes.NodeType, err error)
- func (k Keeper) VolumeReport(ctx sdk.Context, walletVolumes []types.SingleWalletVolume, ...) (totalConsumedOzone sdk.Dec, err error)
- func (k Keeper) Withdraw(ctx sdk.Context, amount sdk.Coins, walletAddress sdk.AccAddress, ...) error
Constants ¶
const ( QueryVolumeReport = "query_volume_report" QueryPotRewardsByReportEpoch = "query_pot_rewards_by_report_epoch" QueryPotRewardsByWalletAddr = "query_pot_rewards_by_wallet_address" QueryPotSlashingByWalletAddr = "query_pot_slashing_by_wallet_address" QueryDefaultLimit = 100 )
Variables ¶
This section is empty.
Functions ¶
func NewQuerier ¶
NewQuerier creates a new querier for pot clients.
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 CreateTestInput ¶
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) CalcMiningRewardInTotal ¶
func (k Keeper) CalcMiningRewardInTotal(ctx sdk.Context, distributeGoal types.DistributeGoal) (types.DistributeGoal, error)
allocate mining reward from foundation account
func (Keeper) CalcMiningRewardInTotalForTestnet ¶ added in v0.6.0
func (k Keeper) CalcMiningRewardInTotalForTestnet(ctx sdk.Context, distributeGoal types.DistributeGoal) ( types.DistributeGoal, []regtypes.IndexingNode, []regtypes.ResourceNode, error)
allocate mining reward from foundation account
func (Keeper) CalcRewardForIndexingNode ¶
func (Keeper) CalcRewardForIndexingNodeForTestnet ¶ added in v0.6.0
func (k Keeper) CalcRewardForIndexingNodeForTestnet(ctx sdk.Context, distributeGoal types.DistributeGoal, rewardDetailMap map[string]types.Reward, indexNodes []regtypes.IndexingNode, ) (map[string]types.Reward, types.DistributeGoal)
func (Keeper) CalcRewardForResourceNode ¶
func (k Keeper) CalcRewardForResourceNode(ctx sdk.Context, trafficList []types.SingleWalletVolume, distributeGoal types.DistributeGoal, rewardDetailMap map[string]types.Reward, ) (map[string]types.Reward, types.DistributeGoal)
func (Keeper) CalcRewardForResourceNodeForTestnet ¶ added in v0.6.0
func (k Keeper) CalcRewardForResourceNodeForTestnet(ctx sdk.Context, trafficList []types.SingleWalletVolume, distributeGoal types.DistributeGoal, rewardDetailMap map[string]types.Reward, resourceNodes []regtypes.ResourceNode, ) (map[string]types.Reward, types.DistributeGoal)
func (Keeper) CalcTrafficRewardInTotal ¶
func (k Keeper) CalcTrafficRewardInTotal( ctx sdk.Context, trafficList []types.SingleWalletVolume, distributeGoal types.DistributeGoal, ) (sdk.Dec, types.DistributeGoal, error)
func (Keeper) DistributePotReward ¶
func (Keeper) DistributePotRewardForTestnet ¶ added in v0.6.0
func (Keeper) FoundationDeposit ¶ added in v0.5.0
func (Keeper) GetImmatureTotalReward ¶
func (Keeper) GetIndividualReward ¶
func (Keeper) GetLastReportedEpoch ¶ added in v0.5.0
func (Keeper) GetMatureTotalReward ¶
func (Keeper) GetMinedTokens ¶
func (Keeper) GetMiningRewardParamByMinedToken ¶
func (Keeper) GetTotalConsumedUoz ¶ added in v0.6.0
func (k Keeper) GetTotalConsumedUoz(trafficList []types.SingleWalletVolume) sdk.Int
func (Keeper) GetTotalMinedTokens ¶
func (Keeper) GetTrafficReward ¶ added in v0.7.0
func (k Keeper) GetTrafficReward(ctx sdk.Context, trafficList []types.SingleWalletVolume) (totalConsumedOzone, result sdk.Dec)
[S] is initial genesis deposit by all resource nodes and meta nodes at t=0 The current unissued prepay Volume Pool [pt] is the total remaining prepay uSTOS kept by Stratos Network but not issued to Resource Node as rewards. At time t=0, pt=0 total consumed Ozone is [Y] The remaining total Ozone limit [lt] is the upper bound of total Ozone that users can purchase from Stratos blockchain. the total generated traffic rewards as [R] R = (S + Pt) * Y / (Lt + Y)
func (Keeper) GetVolumeReport ¶
func (Keeper) IteratorImmatureTotal ¶ added in v0.7.0
func (Keeper) IteratorIndividualReward ¶ added in v0.7.0
func (Keeper) IteratorMatureTotal ¶ added in v0.7.0
func (Keeper) MiningRewardParams ¶
func (k Keeper) MiningRewardParams(ctx sdk.Context) (res []types.MiningRewardParam)
func (Keeper) RewardDenom ¶ added in v0.6.0
func (Keeper) SetImmatureTotalReward ¶ added in v0.7.0
func (Keeper) SetIndividualReward ¶ added in v0.7.0
func (Keeper) SetLastReportedEpoch ¶ added in v0.7.0
func (Keeper) SetMatureTotalReward ¶ added in v0.7.0
func (Keeper) SetTotalMinedTokens ¶ added in v0.7.0
func (Keeper) SetVolumeReport ¶
func (Keeper) SlashingResourceNode ¶ added in v0.6.2
func (k Keeper) SlashingResourceNode(ctx sdk.Context, p2pAddr stratos.SdsAddress, walletAddr sdk.AccAddress, ozAmt sdk.Int, suspend bool) (amt sdk.Int, nodeType regtypes.NodeType, err error)
This function only record slashing amount.
Deduct slashing amount when: 1, calculate upcoming mature reward, deduct from mature_total & upcoming mature reward. 2, unstaking indexing node. 3, unstaking resource node.