Versions in this module Expand all Collapse all v1 v1.0.2 Jan 27, 2022 v1.0.1 Dec 1, 2021 Changes in this version + type GovCtx struct + BcName string + Contract contract.Manager + Ledger LedgerRely + RealLedger *rledger.Ledger + func NewGovCtx(bcName string, leg LedgerRely, contract contract.Manager) (*GovCtx, error) + type GovManager interface + DetermineGovTokenIfInitialized func() (bool, error) + GetGovTokenBalance func(accountName string) (*pb.GovernTokenBalance, error) + func NewGovManager(ctx *GovCtx) (GovManager, error) + type KernMethod struct + BcName string + NewGovResourceAmount int64 + Predistribution []xledger.Predistribution + func NewKernContractMethod(bcName string, NewGovResourceAmount int64, ...) *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 interface + CalGovTokenTotal func() (*big.Int, error) + GetGenesisPreDistribution func() ([]xledger.Predistribution, error) + GetNewGovGas func() (int64, error) + GetTipXMSnapshotReader func() (ledger.XMSnapshotReader, error) + type Manager struct + Ctx *GovCtx + func (mgr *Manager) AllTokens(ctx contract.KContext) (*contract.Response, error) + func (mgr *Manager) BonusObtain(ctx contract.KContext) (*contract.Response, error) + func (mgr *Manager) BonusQuery(ctx contract.KContext) (*contract.Response, error) + func (mgr *Manager) DetermineGovTokenIfInitialized() (bool, error) + func (mgr *Manager) GetGovTokenBalance(accountName string) (*pb.GovernTokenBalance, error) + func (mgr *Manager) GetObjectBySnapshot(bucket string, object []byte) ([]byte, error) + func (mgr *Manager) SyncCheckBonus(ctx contract.KContext, height int64) (*big.Int, error)