Documentation ¶
Index ¶
- Variables
- func FundAccount(input TestInput, addr sdk.AccAddress, amounts sdk.Coins) error
- func HandleAddBurnTaxExemptionAddressProposal(ctx sdk.Context, k Keeper, p *types.AddBurnTaxExemptionAddressProposal) error
- func HandleRemoveBurnTaxExemptionAddressProposal(ctx sdk.Context, k Keeper, p *types.RemoveBurnTaxExemptionAddressProposal) error
- func MR(ctx sdk.Context, epoch int64, k Keeper) sdk.Dec
- func MakeEncodingConfig(_ *testing.T) simparams.EncodingConfig
- func MakeTestCodec(t *testing.T) codec.Codec
- func NewQuerier(keeper Keeper) types.QueryServer
- func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey cryptotypes.PubKey, amt math.Int) *stakingtypes.MsgCreateValidator
- func SR(ctx sdk.Context, epoch int64, k Keeper) sdk.Dec
- func TRL(ctx sdk.Context, epoch int64, k Keeper) sdk.Dec
- type Keeper
- func (k Keeper) AddBurnTaxExemptionAddress(ctx sdk.Context, address string)
- func (k Keeper) BurnCoinsFromBurnAccount(ctx sdk.Context)
- func (k Keeper) ClearSRs(ctx sdk.Context)
- func (k Keeper) ClearTRs(ctx sdk.Context)
- func (k Keeper) ClearTSLs(ctx sdk.Context)
- func (k Keeper) GetBurnModuleAccount(ctx sdk.Context) authtypes.ModuleAccountI
- func (k Keeper) GetBurnSplitRate(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) GetEpoch(ctx sdk.Context) int64
- func (k Keeper) GetEpochInitialIssuance(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetMinInitialDepositRatio(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) GetOracleSplitRate(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetRewardWeight(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetSR(ctx sdk.Context, epoch int64) sdk.Dec
- func (k Keeper) GetTR(ctx sdk.Context, epoch int64) sdk.Dec
- func (k Keeper) GetTSL(ctx sdk.Context, epoch int64) math.Int
- func (k Keeper) GetTaxCap(ctx sdk.Context, denom string) math.Int
- func (k Keeper) GetTaxRate(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetTreasuryModuleAccount(ctx sdk.Context) authtypes.ModuleAccountI
- func (k Keeper) HasBurnTaxExemptionAddress(ctx sdk.Context, addresses ...string) bool
- func (k Keeper) HasBurnTaxExemptionContract(ctx sdk.Context, address string) bool
- func (k Keeper) IterateTaxCap(ctx sdk.Context, handler func(denom string, taxCap math.Int) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MiningIncrement(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) PeekEpochSeigniorage(ctx sdk.Context) math.Int
- func (k Keeper) PeekEpochTaxProceeds(ctx sdk.Context) sdk.Coins
- func (k Keeper) RecordEpochInitialIssuance(ctx sdk.Context)
- func (k Keeper) RecordEpochTaxProceeds(ctx sdk.Context, delta sdk.Coins)
- func (k Keeper) RemoveBurnTaxExemptionAddress(ctx sdk.Context, address string) error
- func (k Keeper) RewardPolicy(ctx sdk.Context) (res types.PolicyConstraints)
- func (k Keeper) SeigniorageBurdenTarget(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) SetBurnSplitRate(ctx sdk.Context, burnTaxSplit sdk.Dec)
- func (k Keeper) SetEpochInitialIssuance(ctx sdk.Context, issuance sdk.Coins)
- func (k Keeper) SetEpochTaxProceeds(ctx sdk.Context, taxProceeds sdk.Coins)
- func (k Keeper) SetMinInitialDepositRatio(ctx sdk.Context, minInitialDepositRatio sdk.Dec)
- func (k Keeper) SetOracleSplitRate(ctx sdk.Context, oracleSplit sdk.Dec)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetRewardWeight(ctx sdk.Context, rewardWeight math.LegacyDec)
- func (k Keeper) SetSR(ctx sdk.Context, epoch int64, sr sdk.Dec)
- func (k Keeper) SetTR(ctx sdk.Context, epoch int64, tr sdk.Dec)
- func (k Keeper) SetTSL(ctx sdk.Context, epoch int64, tsl math.Int)
- func (k Keeper) SetTaxCap(ctx sdk.Context, denom string, cap math.Int)
- func (k Keeper) SetTaxRate(ctx sdk.Context, taxRate sdk.Dec)
- func (k Keeper) SettleSeigniorage(ctx sdk.Context)
- func (k Keeper) TaxPolicy(ctx sdk.Context) (res types.PolicyConstraints)
- func (k Keeper) UpdateIndicators(ctx sdk.Context)
- func (k Keeper) UpdateRewardPolicy(ctx sdk.Context) (newRewardWeight sdk.Dec)
- func (k Keeper) UpdateTaxCap(ctx sdk.Context) sdk.Coins
- func (k Keeper) UpdateTaxPolicy(ctx sdk.Context) (newTaxRate sdk.Dec)
- func (k Keeper) WindowLong(ctx sdk.Context) (res uint64)
- func (k Keeper) WindowProbation(ctx sdk.Context) (res uint64)
- func (k Keeper) WindowShort(ctx sdk.Context) (res uint64)
- type Migrator
- type TestInput
Constants ¶
This section is empty.
Variables ¶
var ( ValPubKeys = simtestutil.CreateTestPubKeys(5) PubKeys = []crypto.PubKey{ secp256k1.GenPrivKey().PubKey(), secp256k1.GenPrivKey().PubKey(), secp256k1.GenPrivKey().PubKey(), } Addrs = []sdk.AccAddress{ sdk.AccAddress(PubKeys[0].Address()), sdk.AccAddress(PubKeys[1].Address()), sdk.AccAddress(PubKeys[2].Address()), } ValAddrs = []sdk.ValAddress{ sdk.ValAddress(PubKeys[0].Address()), sdk.ValAddress(PubKeys[1].Address()), sdk.ValAddress(PubKeys[2].Address()), } InitTokens = sdk.TokensFromConsensusPower(200, sdk.DefaultPowerReduction) InitCoins = sdk.NewCoins(sdk.NewCoin(core.MicroLunaDenom, InitTokens)) )
var ModuleBasics = module.NewBasicManager( customauth.AppModuleBasic{}, custombank.AppModuleBasic{}, customdistr.AppModuleBasic{}, customstaking.AppModuleBasic{}, customparams.AppModuleBasic{}, oracle.AppModuleBasic{}, market.AppModuleBasic{}, )
Functions ¶
func FundAccount ¶
FundAccount is a utility function that funds an account by minting and sending the coins to the address. This should be used for testing purposes only!
func MakeEncodingConfig ¶
func MakeEncodingConfig(_ *testing.T) simparams.EncodingConfig
func NewQuerier ¶
func NewQuerier(keeper Keeper) types.QueryServer
NewQuerier returns an implementation of the market QueryServer interface for the provided Keeper.
func NewTestMsgCreateValidator ¶
func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey cryptotypes.PubKey, amt math.Int) *stakingtypes.MsgCreateValidator
NewTestMsgCreateValidator test msg creator
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the treasury store
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, paramSpace paramstypes.Subspace, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, marketKeeper types.MarketKeeper, oracleKeeper types.OracleKeeper, stakingKeeper types.StakingKeeper, distrKeeper types.DistributionKeeper, wasmKeeper *wasmkeeper.Keeper, distributionModuleName string, ) Keeper
NewKeeper creates a new treasury Keeper instance
func (Keeper) AddBurnTaxExemptionAddress ¶
Burn tax exemption list
func (Keeper) BurnCoinsFromBurnAccount ¶
BurnCoinsFromBurnAccount burn all coins from burn account
func (Keeper) GetBurnModuleAccount ¶
func (k Keeper) GetBurnModuleAccount(ctx sdk.Context) authtypes.ModuleAccountI
GetBurnModuleAccount returns burn ModuleAccount
func (Keeper) GetEpoch ¶
GetEpoch returns current epoch of (current block height + cumulated block height of past chains)
func (Keeper) GetEpochInitialIssuance ¶
GetEpochInitialIssuance returns epoch initial issuance
func (Keeper) GetMinInitialDepositRatio ¶
func (Keeper) GetOracleSplitRate ¶ added in v3.1.0
func (Keeper) GetRewardWeight ¶
GetRewardWeight loads the reward weight
func (Keeper) GetTaxCap ¶
GetTaxCap gets the tax cap denominated in integer units of the reference {denom}
func (Keeper) GetTaxRate ¶
GetTaxRate loads the tax rate
func (Keeper) GetTreasuryModuleAccount ¶
func (k Keeper) GetTreasuryModuleAccount(ctx sdk.Context) authtypes.ModuleAccountI
GetTreasuryModuleAccount returns treasury ModuleAccount
func (Keeper) HasBurnTaxExemptionAddress ¶
HasBurnTaxExemptionAddress returns true if all provided addresses are in the tax exemption whitelist
func (Keeper) HasBurnTaxExemptionContract ¶
HasBurnTaxExemptionContract returns true if a provided address is a smart contract AND is in the tax exemption list
func (Keeper) IterateTaxCap ¶
func (k Keeper) IterateTaxCap(ctx sdk.Context, handler func(denom string, taxCap math.Int) (stop bool))
IterateTaxCap iterates all tax cap
func (Keeper) MiningIncrement ¶
MiningIncrement is a factor used to determine how fast MRL should grow over time
func (Keeper) PeekEpochSeigniorage ¶
PeekEpochSeigniorage returns epoch seigniorage
func (Keeper) PeekEpochTaxProceeds ¶
PeekEpochTaxProceeds peeks the total amount of taxes that have been collected in the given epoch.
func (Keeper) RecordEpochInitialIssuance ¶
RecordEpochInitialIssuance updates epoch initial issuance from supply keeper
func (Keeper) RecordEpochTaxProceeds ¶
RecordEpochTaxProceeds adds tax proceeds that have been added this epoch
func (Keeper) RemoveBurnTaxExemptionAddress ¶
func (Keeper) RewardPolicy ¶
func (k Keeper) RewardPolicy(ctx sdk.Context) (res types.PolicyConstraints)
RewardPolicy defines constraints for RewardWeight
func (Keeper) SeigniorageBurdenTarget ¶
SeigniorageBurdenTarget defines fixed target for the Seigniorage Burden. Between 0 and 1.
func (Keeper) SetBurnSplitRate ¶
func (Keeper) SetEpochInitialIssuance ¶
SetEpochInitialIssuance stores epoch initial issuance
func (Keeper) SetEpochTaxProceeds ¶
SetEpochTaxProceeds stores tax proceeds for the given epoch
func (Keeper) SetMinInitialDepositRatio ¶
func (Keeper) SetOracleSplitRate ¶ added in v3.1.0
func (Keeper) SetRewardWeight ¶
SetRewardWeight sets the reward weight
func (Keeper) SetTaxCap ¶
SetTaxCap sets the tax cap denominated in integer units of the reference {denom}
func (Keeper) SetTaxRate ¶
SetTaxRate sets the tax rate
func (Keeper) SettleSeigniorage ¶
SettleSeigniorage computes seigniorage and distributes it to oracle and distribution(community-pool) account
func (Keeper) TaxPolicy ¶
func (k Keeper) TaxPolicy(ctx sdk.Context) (res types.PolicyConstraints)
TaxPolicy defines constraints for TaxRate
func (Keeper) UpdateIndicators ¶
UpdateIndicators updates internal indicators
func (Keeper) UpdateRewardPolicy ¶
UpdateRewardPolicy updates reward-weight with w(t+1) = w(t)*SB_target/SB_rolling(t)
func (Keeper) UpdateTaxCap ¶
UpdateTaxCap updates all denom's tax cap
func (Keeper) UpdateTaxPolicy ¶
UpdateTaxPolicy updates tax-rate with t(t+1) = t(t) * (TL_year(t) + INC) / TL_month(t)
func (Keeper) WindowLong ¶
WindowLong is a long period window for moving average
func (Keeper) WindowProbation ¶
WindowProbation is a period of time to prevent updates
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func (Migrator) Migrate1to2 ¶
Migrate1to2 migrates from version 1 to 2.
type TestInput ¶
type TestInput struct { Ctx sdk.Context Cdc *codec.LegacyAmino TreasuryKeeper Keeper AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper DistrKeeper distrkeeper.Keeper StakingKeeper *stakingkeeper.Keeper MarketKeeper types.MarketKeeper OracleKeeper types.OracleKeeper }