Documentation ¶
Index ¶
- type GovCtx
- type GovManager
- type KernMethod
- func (t *KernMethod) AddTokens(ctx contract.KContext) (*contract.Response, error)
- func (t *KernMethod) CheckTokens(ctx contract.KContext, amount *big.Int) error
- func (t *KernMethod) GetRatio(ctx contract.KContext) (map[string]int64, error)
- func (t *KernMethod) GetRewardRatio(ctx contract.KContext, name string) int64
- func (t *KernMethod) GetVoters(ctx contract.KContext, name string) (map[string]*big.Int, *big.Int, int64)
- func (t *KernMethod) InitGovernTokens(ctx contract.KContext) (*contract.Response, error)
- func (t *KernMethod) LockGovernTokens(ctx contract.KContext) (*contract.Response, error)
- func (t *KernMethod) QueryAccountGovernTokens(ctx contract.KContext) (*contract.Response, error)
- func (t *KernMethod) SubTokens(ctx contract.KContext) (*contract.Response, error)
- func (t *KernMethod) TotalSupply(ctx contract.KContext) (*contract.Response, error)
- func (t *KernMethod) TransferGovernTokens(ctx contract.KContext) (*contract.Response, error)
- func (t *KernMethod) UnLockGovernTokens(ctx contract.KContext) (*contract.Response, error)
- func (t *KernMethod) UpdateCacheTable(ctx contract.KContext) error
- type LedgerRely
- type Manager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GovCtx ¶
type GovManager ¶
type GovManager interface { GetGovTokenBalance(accountName string) (*pb.GovernTokenBalance, error) DetermineGovTokenIfInitialized() (bool, error) }
func NewGovManager ¶
func NewGovManager(ctx *GovCtx) (GovManager, error)
NewGovManager create instance of GovManager
type KernMethod ¶
type KernMethod struct { BcName string NewGovResourceAmount int64 Predistribution []xledger.Predistribution }
func NewKernContractMethod ¶
func NewKernContractMethod(bcName string, NewGovResourceAmount int64, Predistribution []xledger.Predistribution) *KernMethod
func (*KernMethod) CheckTokens ¶
func (*KernMethod) GetRewardRatio ¶
func (t *KernMethod) GetRewardRatio(ctx contract.KContext, name string) int64
获取分红比
func (*KernMethod) GetVoters ¶
func (t *KernMethod) GetVoters(ctx contract.KContext, name string) (map[string]*big.Int, *big.Int, int64)
获取投票数
func (*KernMethod) InitGovernTokens ¶
func (*KernMethod) LockGovernTokens ¶
func (*KernMethod) QueryAccountGovernTokens ¶
func (*KernMethod) TotalSupply ¶
func (*KernMethod) TransferGovernTokens ¶
func (*KernMethod) UnLockGovernTokens ¶
func (*KernMethod) UpdateCacheTable ¶
func (t *KernMethod) UpdateCacheTable(ctx contract.KContext) error
type LedgerRely ¶
type LedgerRely interface { // 从创世块获取创建合约账户消耗gas GetNewGovGas() (int64, error) // 从创世块获取创建合约账户消耗gas GetGenesisPreDistribution() ([]xledger.Predistribution, error) // 获取状态机最新确认快照 GetTipXMSnapshotReader() (ledger.XMSnapshotReader, error) }
type Manager ¶
type Manager struct {
Ctx *GovCtx
}
Manager manages all gov releated data, providing read/write interface
func (*Manager) DetermineGovTokenIfInitialized ¶
DetermineGovTokenIfInitialized
func (*Manager) GetGovTokenBalance ¶
func (mgr *Manager) GetGovTokenBalance(accountName string) (*pb.GovernTokenBalance, error)
GetGovTokenBalance get govern token balance of an account
Click to show internal directories.
Click to hide internal directories.