Versions in this module Expand all Collapse all v1 v1.0.0 Jun 26, 2019 Changes in this version + var ErrDecodeGovChange = errors.New("Failed to decode received governance changes") + var ErrItemNil = errors.New("Governance Item is nil") + var ErrItemNotFound = errors.New("Failed to find governance item") + var ErrNotInitialized = errors.New("Cache not initialized") + var ErrUnmarshalGovChange = errors.New("Failed to unmarshal received governance changes") + var ErrValueTypeMismatch = errors.New("Value's type mismatch") + var ErrVoteValueMismatch = errors.New("Received change mismatches with the value this node has!!") + var GovernanceForbiddenKeyMap = map[string]int + var GovernanceItems = map[int]check + var GovernanceKeyMap = map[string]int + var GovernanceKeyMapReverse = map[int]string + var GovernanceModeMap = map[string]int + var ProposerPolicyMap = map[string]int + var ProposerPolicyMapReverse = map[int]string + func AddGovernanceCacheForTest(g *Governance, num uint64, config *params.ChainConfig) + func CalcGovernanceInfoBlock(num uint64, epoch uint64) uint64 + func CheckGenesisValues(c *params.ChainConfig) error + func GetDefaultCliqueConfig() *params.CliqueConfig + func GetDefaultGovernanceConfig(engine params.EngineType) *params.GovernanceConfig + func GetDefaultIstanbulConfig() *params.IstanbulConfig + func GetDefaultRewardConfig() *params.RewardConfig + type Governance struct + ChainConfig *params.ChainConfig + GovernanceTally []GovernanceTally + GovernanceTallyLock sync.RWMutex + GovernanceVotes []GovernanceVote + TxPool *blockchain.TxPool + func NewGovernance(chainConfig *params.ChainConfig, dbm database.DBManager) *Governance + func (g *Governance) AddVote(key string, val interface{}) bool + func (g *Governance) ClearVotes(num uint64) + func (g *Governance) GetEncodedVote(addr common.Address, number uint64) []byte + func (g *Governance) GetGovernanceChange() GovernanceSet + func (g *Governance) ParseVoteValue(gVote *GovernanceVote) (*GovernanceVote, error) + func (g *Governance) ReadGovernance(num uint64) (uint64, GovernanceSet, error) + func (g *Governance) RemoveVote(key string, value interface{}, number uint64) + func (g *Governance) SetMyVotingPower(t uint64) + func (g *Governance) SetNodeAddress(addr common.Address) + func (g *Governance) SetTotalVotingPower(t uint64) + func (g *Governance) WriteGovernance(num uint64, data GovernanceSet, delta GovernanceSet) error + func (gov *Governance) CanWriteGovernanceState(num uint64) bool + func (gov *Governance) GetGovernanceItemAtNumber(num uint64, key string) (interface{}, error) + func (gov *Governance) GetGovernanceValue(key string) interface{} + func (gov *Governance) GetLatestGovernanceItem(key string) interface{} + func (gov *Governance) HandleGovernanceVote(valset istanbul.ValidatorSet, votes []GovernanceVote, tally []GovernanceTally, ...) (istanbul.ValidatorSet, []GovernanceVote, []GovernanceTally) + func (gov *Governance) ReadGovernanceState() + func (gov *Governance) ReflectVotes(vote GovernanceVote) + func (gov *Governance) SetBlockchain(bc *blockchain.BlockChain) + func (gov *Governance) SetTxPool(txpool *blockchain.TxPool) + func (gov *Governance) UnmarshalJSON(b []byte) error + func (gov *Governance) UpdateCurrentGovernance(num uint64) + func (gov *Governance) UpdateGovernance(number uint64, governance []byte) + func (gov *Governance) ValidateVote(vote *GovernanceVote) (*GovernanceVote, bool) + func (gov *Governance) VerifyGovernance(received []byte) error + func (gov *Governance) WriteGovernanceState(num uint64, isCheckpoint bool) error + type GovernanceKlayAPI struct + func NewGovernanceKlayAPI(gov *Governance, chain *blockchain.BlockChain) *GovernanceKlayAPI + func (api *GovernanceKlayAPI) GasPrice() *big.Int + func (api *GovernanceKlayAPI) GasPriceAt(num *rpc.BlockNumber) (*big.Int, error) + func (api *GovernanceKlayAPI) GasPriceAtNumber(num int64) (uint64, error) + func (api *GovernanceKlayAPI) GetTxGasHumanReadable(num *rpc.BlockNumber) (uint64, error) + type GovernanceSet map[string]interface + func (gs GovernanceSet) SetValue(itemType int, value interface{}) error + func CopyGovernanceSet(dst GovernanceSet, src GovernanceSet) GovernanceSet + type GovernanceTally struct + Key string + Value interface{} + Votes uint64 + type GovernanceVote struct + Key string + Validator common.Address + Value interface{} + type PublicGovernanceAPI struct + func NewGovernanceAPI(gov *Governance) *PublicGovernanceAPI + func (api *PublicGovernanceAPI) ChainConfig() *params.ChainConfig + func (api *PublicGovernanceAPI) ItemsAt(num *rpc.BlockNumber) (GovernanceSet, error) + func (api *PublicGovernanceAPI) MyVotes() []*VoteList + func (api *PublicGovernanceAPI) MyVotingPower() (float64, error) + func (api *PublicGovernanceAPI) NodeAddress() common.Address + func (api *PublicGovernanceAPI) ShowTally() []*returnTally + func (api *PublicGovernanceAPI) TotalVotingPower() (float64, error) + func (api *PublicGovernanceAPI) Vote(key string, val interface{}) (string, error) + type VoteList struct + BlockNum uint64 + Casted bool + Key string + Value interface{} + type VoteStatus struct + Casted bool + Num uint64 + Value interface{}