Documentation
¶
Index ¶
- Constants
- Variables
- func ActiveUnDelFreezeRatio() uint64
- func AddLog(state StateDB, blockNumber uint64, contractAddr common.Address, ...)
- func AdditionalCycleTime() uint64
- func BlocksWillCreate() uint64
- func BuildResult(data string, err *common.BizError) []byte
- func CDFAccount() common.Address
- func CDFBalance() *big.Int
- func CancelProposal_SupportRate() float64
- func CancelProposal_VoteRate() float64
- func CheckEconomicModel() error
- func ConsValidatorNum() uint64
- func DuplicateSignHighSlash() uint32
- func DuplicateSignReportReward() uint32
- func EconomicString() string
- func ElectionDistance() uint64
- func EpochValidatorNum() uint64
- func EvidenceValidEpoch() uint32
- func ExpectedMinutes() uint64
- func FailResult(data string, err *common.BizError) []byte
- func HesitateRatio() uint64
- func Interval() uint64
- func MinimumThreshold() *big.Int
- func NewBlockRewardRate() uint64
- func NewFailResult(err error) []byte
- func NewFailResultByBiz(err *common.BizError) []byte
- func NewResult(data string, err *common.BizError) []byte
- func NewSuccessResult(data string) []byte
- func NumberOfBlockRewardForSlashing() uint32
- func PlatONFoundationYear() uint32
- func PlatONFundAccount() common.Address
- func PlatONFundBalance() *big.Int
- func PrintObjForErr(s string, obj interface{})
- func PrintObject(s string, obj interface{})
- func SetNodeBlockTimeWindow(period uint64)
- func SetPerRoundBlocks(amount uint64)
- func ShiftValidatorNum() uint64
- func StakeThreshold() *big.Int
- func SuccessResult(data string) []byte
- func TextProposalVote_ConsensusRounds() uint64
- func TextProposal_SupportRate() float64
- func TextProposal_VoteRate() float64
- func UnStakeFreezeRatio() uint64
- func VersionProposalActive_ConsensusRounds() uint64
- func VersionProposalVote_ConsensusRounds() uint64
- func VersionProposal_SupportRate() float64
- type EconomicModel
- type Result
- type StateDB
Constants ¶
View Source
const ( DefualtRule = iota StakingRule SlashingRule RestrictingRule RewardRule GovernanceRule )
plugin rule key
View Source
const ( DefaultMainNet = iota // PlatON default main net flag DefaultTestNet // PlatON default test net flag )
Variables ¶
View Source
var (
// 10 LAT
TenLAT, _ = new(big.Int).SetString("10000000000000000000", 10)
// hard code genesis staking balance
// 150W LAT
GeneStakingAmount, _ = new(big.Int).SetString("1500000000000000000000000", 10)
// 100W LAT
MillionLAT, _ = new(big.Int).SetString("1000000000000000000000000", 10)
// 1000W LAT
TenMillionLAT, _ = new(big.Int).SetString("10000000000000000000000000", 10)
)
Functions ¶
func ActiveUnDelFreezeRatio ¶
func ActiveUnDelFreezeRatio() uint64
func AdditionalCycleTime ¶
func AdditionalCycleTime() uint64
func BlocksWillCreate ¶
func BlocksWillCreate() uint64
func CDFAccount ¶ added in v0.7.3
func CDFBalance ¶ added in v0.7.3
func CancelProposal_SupportRate ¶
func CancelProposal_SupportRate() float64
func CancelProposal_VoteRate ¶
func CancelProposal_VoteRate() float64
func CheckEconomicModel ¶
func CheckEconomicModel() error
func ConsValidatorNum ¶
func ConsValidatorNum() uint64
func DuplicateSignReportReward ¶ added in v0.7.3
func DuplicateSignReportReward() uint32
func EconomicString ¶
func EconomicString() string
func ElectionDistance ¶
func ElectionDistance() uint64
func EpochValidatorNum ¶
func EpochValidatorNum() uint64
func EvidenceValidEpoch ¶ added in v0.7.3
func EvidenceValidEpoch() uint32
func HesitateRatio ¶
func HesitateRatio() uint64
func MinimumThreshold ¶
func NewFailResult ¶ added in v0.7.3
func NewFailResultByBiz ¶ added in v0.7.3
func NewSuccessResult ¶ added in v0.7.3
func NumberOfBlockRewardForSlashing ¶ added in v0.7.3
func NumberOfBlockRewardForSlashing() uint32
func PlatONFoundationYear ¶
func PlatONFoundationYear() uint32
func PlatONFundBalance ¶ added in v0.7.3
func PrintObjForErr ¶
func PrintObjForErr(s string, obj interface{})
func PrintObject ¶
func PrintObject(s string, obj interface{})
func SetNodeBlockTimeWindow ¶
func SetNodeBlockTimeWindow(period uint64)
set the value by genesis block
func SetPerRoundBlocks ¶
func SetPerRoundBlocks(amount uint64)
func ShiftValidatorNum ¶
func ShiftValidatorNum() uint64
func SuccessResult ¶
func TextProposalVote_ConsensusRounds ¶
func TextProposalVote_ConsensusRounds() uint64
func TextProposal_SupportRate ¶
func TextProposal_SupportRate() float64
func TextProposal_VoteRate ¶
func TextProposal_VoteRate() float64
func UnStakeFreezeRatio ¶
func UnStakeFreezeRatio() uint64
func VersionProposalActive_ConsensusRounds ¶
func VersionProposalActive_ConsensusRounds() uint64
func VersionProposalVote_ConsensusRounds ¶
func VersionProposalVote_ConsensusRounds() uint64
*****
- Governance config *****
func VersionProposal_SupportRate ¶
func VersionProposal_SupportRate() float64
Types ¶
type EconomicModel ¶
type EconomicModel struct {
Common commonConfig
Staking stakingConfig
Slashing slashingConfig
Gov governanceConfig
Reward rewardConfig
InnerAcc innerAccount
}
total
type StateDB ¶
type StateDB interface {
CreateAccount(common.Address)
SubBalance(common.Address, *big.Int)
AddBalance(common.Address, *big.Int)
GetBalance(common.Address) *big.Int
GetNonce(common.Address) uint64
SetNonce(common.Address, uint64)
GetCodeHash(common.Address) common.Hash
GetCode(common.Address) []byte
SetCode(common.Address, []byte)
GetCodeSize(common.Address) int
// todo: new func for abi of contract.
GetAbiHash(common.Address) common.Hash
GetAbi(common.Address) []byte
SetAbi(common.Address, []byte)
AddRefund(uint64)
SubRefund(uint64)
GetRefund() uint64
// todo: hash -> bytes
GetCommittedState(common.Address, []byte) []byte
//GetState(common.Address, common.Hash) common.Hash
//SetState(common.Address, common.Hash, common.Hash)
GetState(common.Address, []byte) []byte
SetState(common.Address, []byte, []byte)
Suicide(common.Address) bool
HasSuicided(common.Address) bool
// Exist reports whether the given account exists in state.
// Notably this should also return true for suicided accounts.
Exist(common.Address) bool
// Empty returns whether the given account is empty. Empty
// is defined according to EIP161 (balance = nonce = code = 0).
Empty(common.Address) bool
RevertToSnapshot(int)
Snapshot() int
AddLog(*types.Log)
AddPreimage(common.Hash, []byte)
ForEachStorage(common.Address, func(common.Hash, common.Hash) bool)
//ppos add
TxHash() common.Hash
TxIdx() uint32
IntermediateRoot(deleteEmptyObjects bool) common.Hash
}
StateDB is an Plugin database for full state querying.
Click to show internal directories.
Click to hide internal directories.