Documentation ¶
Index ¶
- func ErrFailedToMarshalConsumptionMeta(err error) sdk.Error
- func ErrFailedToMarshalGlobalMeta(err error) sdk.Error
- func ErrFailedToMarshalInflationPool(err error) sdk.Error
- func ErrFailedToMarshalTPS(err error) sdk.Error
- func ErrFailedToMarshalTime(err error) sdk.Error
- func ErrFailedToMarshalTimeEventList(err error) sdk.Error
- func ErrFailedToUnmarshalConsumptionMeta(err error) sdk.Error
- func ErrFailedToUnmarshalGlobalMeta(err error) sdk.Error
- func ErrFailedToUnmarshalInflationPool(err error) sdk.Error
- func ErrFailedToUnmarshalLinoStakeStatistic(err error) sdk.Error
- func ErrFailedToUnmarshalTPS(err error) sdk.Error
- func ErrFailedToUnmarshalTime(err error) sdk.Error
- func ErrFailedToUnmarshalTimeEventList(err error) sdk.Error
- func ErrGlobalConsumptionMetaNotFound() sdk.Error
- func ErrGlobalMetaNotFound() sdk.Error
- func ErrGlobalTPSNotFound() sdk.Error
- func ErrGlobalTimeNotFound() sdk.Error
- func ErrInflationPoolNotFound() sdk.Error
- func ErrLinoStakeStatisticNotFound() sdk.Error
- func GetConsumptionMetaKey() []byte
- func GetGlobalMetaKey() []byte
- func GetInflationPoolKey() []byte
- func GetLinoStakeStatKey(day int64) []byte
- func GetTPSKey() []byte
- func GetTimeEventListKey(unixTime int64) []byte
- func GetTimeKey() []byte
- type ConsumptionMeta
- type ConsumptionMetaIR
- type EventCache
- type GlobalMeta
- type GlobalMisc
- type GlobalMiscIR
- type GlobalStakeStatDayRow
- type GlobalStorage
- func (gs GlobalStorage) Export(ctx sdk.Context) *GlobalTables
- func (gs GlobalStorage) GetConsumptionMeta(ctx sdk.Context) (*ConsumptionMeta, sdk.Error)
- func (gs GlobalStorage) GetGlobalMeta(ctx sdk.Context) (*GlobalMeta, sdk.Error)
- func (gs GlobalStorage) GetGlobalTime(ctx sdk.Context) (*GlobalTime, sdk.Error)
- func (gs GlobalStorage) GetInflationPool(ctx sdk.Context) (*InflationPool, sdk.Error)
- func (gs GlobalStorage) GetLinoStakeStat(ctx sdk.Context, day int64) (*LinoStakeStat, sdk.Error)
- func (gs GlobalStorage) GetTPS(ctx sdk.Context) (*TPS, sdk.Error)
- func (gs GlobalStorage) GetTimeEventList(ctx sdk.Context, unixTime int64) (*types.TimeEventList, sdk.Error)
- func (gs GlobalStorage) Import(ctx sdk.Context, tb *GlobalTablesIR)
- func (gs GlobalStorage) InitGlobalState(ctx sdk.Context, totalLino types.Coin) sdk.Error
- func (gs GlobalStorage) InitGlobalStateWithConfig(ctx sdk.Context, totalLino types.Coin, param InitParamList) sdk.Error
- func (gs GlobalStorage) RemoveTimeEventList(ctx sdk.Context, unixTime int64) sdk.Error
- func (gs GlobalStorage) SetConsumptionMeta(ctx sdk.Context, consumptionMeta *ConsumptionMeta) sdk.Error
- func (gs GlobalStorage) SetGlobalMeta(ctx sdk.Context, globalMeta *GlobalMeta) sdk.Error
- func (gs GlobalStorage) SetGlobalTime(ctx sdk.Context, globalTime *GlobalTime) sdk.Error
- func (gs GlobalStorage) SetInflationPool(ctx sdk.Context, inflationPool *InflationPool) sdk.Error
- func (gs GlobalStorage) SetLinoStakeStat(ctx sdk.Context, day int64, lps *LinoStakeStat) sdk.Error
- func (gs GlobalStorage) SetTPS(ctx sdk.Context, tps *TPS) sdk.Error
- func (gs GlobalStorage) SetTimeEventList(ctx sdk.Context, unixTime int64, lst *types.TimeEventList) sdk.Error
- func (gs GlobalStorage) WireCodec() *wire.Codec
- type GlobalTables
- type GlobalTablesIR
- type GlobalTime
- type GlobalTimeEventTimeRow
- type InflationPool
- type InitParamList
- type LinoStakeStat
- type TPS
- type TPSIR
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrFailedToMarshalConsumptionMeta ¶
ErrFailedToMarshalConsumptionMeta - error if marshal consumption meta failed
func ErrFailedToMarshalGlobalMeta ¶
ErrFailedToMarshalGlobalMeta - error if marshal global meta failed
func ErrFailedToMarshalInflationPool ¶
ErrFailedToMarshalInflationPool - error if marshal inflation pool failed
func ErrFailedToMarshalTPS ¶
ErrFailedToMarshalTPS - error if marshal tps failed
func ErrFailedToMarshalTime ¶
ErrFailedToMarshalTime - error if marshal time failed
func ErrFailedToMarshalTimeEventList ¶
ErrFailedToMarshalTimeEventList - error if marshal time event list failed
func ErrFailedToUnmarshalConsumptionMeta ¶
ErrFailedToUnmarshalConsumptionMeta - error if unmarshal consumption meta failed
func ErrFailedToUnmarshalGlobalMeta ¶
ErrFailedToUnmarshalGlobalMeta - error if unmarshal global meta failed
func ErrFailedToUnmarshalInflationPool ¶
ErrFailedToUnmarshalInflationPool - error if unmarshal inflation pool failed
func ErrFailedToUnmarshalLinoStakeStatistic ¶ added in v0.1.1
ErrFailedToUnmarshalLinoStakeStatistic - error if unmarshal lino power statistic failed
func ErrFailedToUnmarshalTPS ¶
ErrFailedToUnmarshalTPS - error if unmarshal tps failed
func ErrFailedToUnmarshalTime ¶
ErrFailedToUnmarshalTime - error if unmarshal time failed
func ErrFailedToUnmarshalTimeEventList ¶
ErrFailedToUnmarshalTimeEventList - error if unmarshal time event list failed
func ErrGlobalConsumptionMetaNotFound ¶
ErrGlobalConsumptionMetaNotFound - error if global consumption meta is not found in KVStore
func ErrGlobalMetaNotFound ¶
ErrGlobalMetaNotFound - error if global meta not found in KVStore
func ErrGlobalTPSNotFound ¶
ErrGlobalTPSNotFound - error if global tps is not found in KVStore
func ErrGlobalTimeNotFound ¶
ErrGlobalTimeNotFound - error if global time is not found in KVStore
func ErrInflationPoolNotFound ¶
ErrInflationPoolNotFound - error if inflation pool is not found in KVStore
func ErrLinoStakeStatisticNotFound ¶ added in v0.1.1
ErrLinoStakeStatisticNotFound - error if lino power statistic not found in KVStore
func GetConsumptionMetaKey ¶
func GetConsumptionMetaKey() []byte
GetConsumptionMetaKey - "consumption meta substore"
func GetInflationPoolKey ¶
func GetInflationPoolKey() []byte
GetInflationPoolKey - "inflation pool substore"
func GetLinoStakeStatKey ¶ added in v0.1.1
GetLinoStakeStatKey - get lino power statistic at day from KVStore
func GetTimeEventListKey ¶
GetTimeEventListKey - get time event list from KVStore
Types ¶
type ConsumptionMeta ¶
type ConsumptionMeta struct { ConsumptionFrictionRate sdk.Dec `json:"consumption_friction_rate"` ConsumptionWindow types.Coin `json:"consumption_window"` ConsumptionRewardPool types.Coin `json:"consumption_reward_pool"` ConsumptionFreezingPeriodSec int64 `json:"consumption_freezing_period_second"` }
ConsumptionMeta ConsumptionFrictionRate: percentage the user consumption deducted and added to the TotalLinoInflationPool ConsumptionWindow records all content related consumption within the freezing period ConsumptionFreezingPeriodHr is the time content createor can get remain consumption after friction
func (*ConsumptionMeta) ToIR ¶ added in v0.2.0
func (c *ConsumptionMeta) ToIR() ConsumptionMetaIR
ToIR -
type ConsumptionMetaIR ¶ added in v0.2.0
type ConsumptionMetaIR struct { ConsumptionFrictionRate string `json:"consumption_friction_rate"` ConsumptionWindow types.Coin `json:"consumption_window"` ConsumptionRewardPool types.Coin `json:"consumption_reward_pool"` ConsumptionFreezingPeriodSec int64 `json:"consumption_freezing_period_second"` }
ConsumptionMetaIR - ConsumptionFrictionRate rat -> float string
type EventCache ¶ added in v0.2.0
type GlobalMeta ¶
type GlobalMeta struct { TotalLinoCoin types.Coin `json:"total_lino_coin"` LastYearTotalLinoCoin types.Coin `json:"last_year_total_lino_coin"` LastYearCumulativeConsumption types.Coin `json:"last_year_cumulative_consumption"` CumulativeConsumption types.Coin `json:"cumulative_consumption"` }
GlobalMeta - global statistic information
type GlobalMisc ¶ added in v0.2.0
type GlobalMisc struct { Meta GlobalMeta `json:"meta"` InflationPool InflationPool `json:"inflation_pool"` ConsumptionMeta ConsumptionMeta `json:"consumption_meta"` TPS TPS `json:"tps"` Time GlobalTime `json:"time"` }
GlobalMisc - a bunch of global variables with no pk, pk: none
type GlobalMiscIR ¶ added in v0.2.0
type GlobalMiscIR struct { Meta GlobalMeta `json:"meta"` InflationPool InflationPool `json:"inflation_pool"` ConsumptionMeta ConsumptionMetaIR `json:"consumption_meta"` TPS TPSIR `json:"tps"` Time GlobalTime `json:"time"` }
GlobalMiscIR - ConsumptionMeta changed.
type GlobalStakeStatDayRow ¶ added in v0.2.0
type GlobalStakeStatDayRow struct { Day int64 `json:"day"` StakeStat LinoStakeStat `json:"stake_stat"` }
GlobalStakeStatDayRow - stake stats of a day, pk: day
type GlobalStorage ¶
type GlobalStorage struct {
// contains filtered or unexported fields
}
GlobalStorage - global storage
func NewGlobalStorage ¶
func NewGlobalStorage(key sdk.StoreKey) GlobalStorage
NewGlobalStorage - new global storage
func (GlobalStorage) Export ¶ added in v0.2.0
func (gs GlobalStorage) Export(ctx sdk.Context) *GlobalTables
Export - export global tables.
func (GlobalStorage) GetConsumptionMeta ¶
func (gs GlobalStorage) GetConsumptionMeta(ctx sdk.Context) (*ConsumptionMeta, sdk.Error)
GetConsumptionMeta - get consumption meta from KVStore
func (GlobalStorage) GetGlobalMeta ¶
func (gs GlobalStorage) GetGlobalMeta(ctx sdk.Context) (*GlobalMeta, sdk.Error)
GetGlobalMeta - get global meta from KVStore
func (GlobalStorage) GetGlobalTime ¶
func (gs GlobalStorage) GetGlobalTime(ctx sdk.Context) (*GlobalTime, sdk.Error)
GetGlobalTime - get global time from KVStore
func (GlobalStorage) GetInflationPool ¶
func (gs GlobalStorage) GetInflationPool(ctx sdk.Context) (*InflationPool, sdk.Error)
GetInflationPool - get inflation pool from KVStore
func (GlobalStorage) GetLinoStakeStat ¶ added in v0.1.1
func (gs GlobalStorage) GetLinoStakeStat(ctx sdk.Context, day int64) (*LinoStakeStat, sdk.Error)
GetLinoStakeStat - get lino power statistic at given day
func (GlobalStorage) GetTimeEventList ¶
func (gs GlobalStorage) GetTimeEventList(ctx sdk.Context, unixTime int64) (*types.TimeEventList, sdk.Error)
GetTimeEventList - get time event list at given unix time
func (GlobalStorage) Import ¶ added in v0.2.0
func (gs GlobalStorage) Import(ctx sdk.Context, tb *GlobalTablesIR)
Import from tablesIR.
func (GlobalStorage) InitGlobalState ¶
InitGlobalState - initialization based on code
func (GlobalStorage) InitGlobalStateWithConfig ¶
func (gs GlobalStorage) InitGlobalStateWithConfig( ctx sdk.Context, totalLino types.Coin, param InitParamList) sdk.Error
InitGlobalStateWithConfig - initialization based on genesis config file
func (GlobalStorage) RemoveTimeEventList ¶
RemoveTimeEventList - remove time event list at given unix time
func (GlobalStorage) SetConsumptionMeta ¶
func (gs GlobalStorage) SetConsumptionMeta(ctx sdk.Context, consumptionMeta *ConsumptionMeta) sdk.Error
SetConsumptionMeta - set consumption meta to KVStore
func (GlobalStorage) SetGlobalMeta ¶
func (gs GlobalStorage) SetGlobalMeta(ctx sdk.Context, globalMeta *GlobalMeta) sdk.Error
SetGlobalMeta - set global meta to KVStore
func (GlobalStorage) SetGlobalTime ¶
func (gs GlobalStorage) SetGlobalTime(ctx sdk.Context, globalTime *GlobalTime) sdk.Error
SetGlobalTime - set global time to KVStore
func (GlobalStorage) SetInflationPool ¶
func (gs GlobalStorage) SetInflationPool(ctx sdk.Context, inflationPool *InflationPool) sdk.Error
SetInflationPool - set inflation pool to KVStore
func (GlobalStorage) SetLinoStakeStat ¶ added in v0.1.1
func (gs GlobalStorage) SetLinoStakeStat(ctx sdk.Context, day int64, lps *LinoStakeStat) sdk.Error
SetLinoStakeStat - set lino power statistic at given day
func (GlobalStorage) SetTimeEventList ¶
func (gs GlobalStorage) SetTimeEventList(ctx sdk.Context, unixTime int64, lst *types.TimeEventList) sdk.Error
SetTimeEventList - set time event list at given unix time
func (GlobalStorage) WireCodec ¶
func (gs GlobalStorage) WireCodec() *wire.Codec
WireCodec - access to global storage codec
type GlobalTables ¶ added in v0.2.0
type GlobalTables struct { GlobalTimeEventLists []GlobalTimeEventTimeRow `json:"global_time_event_lists"` GlobalStakeStats []GlobalStakeStatDayRow `json:"global_stake_stats"` GlobalMisc GlobalMisc `json:"global_misc"` }
GlobalTables state of global.
type GlobalTablesIR ¶ added in v0.2.0
type GlobalTablesIR struct { GlobalTimeEventLists []GlobalTimeEventTimeRow `json:"global_time_event_lists"` GlobalStakeStats []GlobalStakeStatDayRow `json:"global_stake_stats"` GlobalMisc GlobalMiscIR `json:"global_misc"` }
GlobalTablesIR - GlobalMisc changed.
type GlobalTime ¶
type GlobalTime struct { ChainStartTime int64 `json:"chain_start_time"` LastBlockTime int64 `json:"last_block_time"` PastMinutes int64 `json:"past_minutes"` }
GlobalTime - global time
type GlobalTimeEventTimeRow ¶ added in v0.2.0
type GlobalTimeEventTimeRow struct { UnixTime int64 `json:"unix_time"` TimeEventList types.TimeEventList `json:"time_event_list"` }
GlobalTimeEventTimeRow - events, pk: UnixTime
type InflationPool ¶
type InflationPool struct { InfraInflationPool types.Coin `json:"infra_inflation_pool"` DeveloperInflationPool types.Coin `json:"developer_inflation_pool"` ValidatorInflationPool types.Coin `json:"validator_inflation_pool"` }
InflationPool, determined by GlobalAllocation InfraInflationPool inflation pool for infra TotalContentCreatorInflationPool total inflation pool for content creator this year DistributedContentCreatorInflationPool inflation alrady distributed DeveloperInflationPool inflation pool for developer ValidatorInflationPool inflation pool for validator
type InitParamList ¶
type InitParamList struct { MaxTPS sdk.Dec `json:"max_tps"` ConsumptionFrictionRate sdk.Dec `json:"consumption_friction_rate"` ConsumptionFreezingPeriodSec int64 `json:"consumption_freezing_period_second"` }
InitParamList - genesis parameters
type LinoStakeStat ¶ added in v0.1.1
type LinoStakeStat struct { TotalConsumptionFriction types.Coin `json:"total_consumption_friction"` UnclaimedFriction types.Coin `json:"unclaimed_friction"` TotalLinoStake types.Coin `json:"total_lino_power"` UnclaimedLinoStake types.Coin `json:"unclaimed_lino_power"` }
LinoStakeStat - records the information needed by lino power deposit, update and store daily.