Versions in this module Expand all Collapse all v1 v1.0.5 Jan 22, 2020 Changes in this version + const CandidateStatusOffline + const CandidateStatusOnline + const MaxDelegatorsPerCandidate + const UnbondPeriod + var ValidatorMaxAbsentTimes = 12 + var ValidatorMaxAbsentWindow = 24 + type Account struct + Balance Balances + MultisigData Multisig + Nonce uint64 + type Balance struct + Amount *big.Int + Coin types.CoinSymbol + type Balances struct + Data map[types.CoinSymbol]*big.Int + func (b *Balances) DecodeRLP(s *rlp.Stream) error + func (b Balances) EncodeRLP(w io.Writer) error + type Candidate struct + Commission uint + CreatedAtBlock uint + OwnerAddress types.Address + PubKey types.Pubkey + RewardAddress types.Address + Stakes []Stake + Status byte + TotalBipStake *big.Int + func (candidate Candidate) GetAddress() [20]byte + func (candidate Candidate) GetStakeOfAddress(addr types.Address, coin types.CoinSymbol) *Stake + func (candidate Candidate) String() string + type Candidates []Candidate + type Coin struct + Crr uint + Name string + ReserveBalance *big.Int + Symbol types.CoinSymbol + Volume *big.Int + func (coin Coin) String() string + type FrozenFund struct + Address types.Address + CandidateKey []byte + Coin types.CoinSymbol + Value *big.Int + type FrozenFunds struct + List []FrozenFund + func (f FrozenFunds) String() string + type ImmutableTree struct + func NewImmutableTree(db dbm.DB) *ImmutableTree + func (t *ImmutableTree) DeleteVersion(version int64) error + func (t *ImmutableTree) Get(key []byte) (index int64, value []byte) + func (t *ImmutableTree) GetImmutable() *ImmutableTree + func (t *ImmutableTree) GetImmutableAtHeight(version int64) (*ImmutableTree, error) + func (t *ImmutableTree) Hash() []byte + func (t *ImmutableTree) Iterate(fn func(key []byte, value []byte) bool) (stopped bool) + func (t *ImmutableTree) LazyLoadVersion(targetVersion int64) (int64, error) + func (t *ImmutableTree) LoadVersion(targetVersion int64) (int64, error) + func (t *ImmutableTree) Remove(key []byte) ([]byte, bool) + func (t *ImmutableTree) SaveVersion() ([]byte, int64, error) + func (t *ImmutableTree) Set(key, value []byte) bool + func (t *ImmutableTree) Version() int64 + type Multisig struct + Addresses []types.Address + Threshold uint + Weights []uint + func (m *Multisig) Address() types.Address + func (m *Multisig) GetWeight(address types.Address) uint + type MutableTree struct + func NewMutableTree(db dbm.DB) *MutableTree + func (t *MutableTree) DeleteVersion(version int64) error + func (t *MutableTree) Get(key []byte) (index int64, value []byte) + func (t *MutableTree) GetImmutable() *ImmutableTree + func (t *MutableTree) GetImmutableAtHeight(version int64) (*ImmutableTree, error) + func (t *MutableTree) Hash() []byte + func (t *MutableTree) Iterate(fn func(key []byte, value []byte) bool) (stopped bool) + func (t *MutableTree) LazyLoadVersion(targetVersion int64) (int64, error) + func (t *MutableTree) LoadVersion(targetVersion int64) (int64, error) + func (t *MutableTree) Remove(key []byte) ([]byte, bool) + func (t *MutableTree) SaveVersion() ([]byte, int64, error) + func (t *MutableTree) Set(key, value []byte) bool + func (t *MutableTree) Version() int64 + type Stake struct + BipValue *big.Int + Coin types.CoinSymbol + Owner types.Address + Value *big.Int + func (s *Stake) CalcBipValue(context *StateDB) *big.Int + func (s *Stake) CalcSimulatedBipValue(context *StateDB) *big.Int + func (s *Stake) MarshalJSON() ([]byte, error) + type StakeCache struct + BipValue *big.Int + TotalValue *big.Int + type StateDB struct + func New(height uint64, db dbm.DB, keepState bool) (*StateDB, error) + func NewForCheck(height uint64, db dbm.DB) (*StateDB, error) + func NewForCheckFromDeliver(s *StateDB) *StateDB + func (s *StateDB) AccountExists(address types.Address) bool + func (s *StateDB) AddAccumReward(pubkey types.Pubkey, reward *big.Int) + func (s *StateDB) AddBalance(addr types.Address, coinSymbol types.CoinSymbol, amount *big.Int) + func (s *StateDB) AddCoinReserve(symbol types.CoinSymbol, value *big.Int) + func (s *StateDB) AddCoinVolume(symbol types.CoinSymbol, value *big.Int) + func (s *StateDB) AddTotalSlashed(value *big.Int) + func (s *StateDB) CandidateExists(key types.Pubkey) bool + func (s *StateDB) CandidatesCount() int + func (s *StateDB) CheckForInvariants() error + func (s *StateDB) Clear() + func (s *StateDB) ClearCandidates() + func (s *StateDB) ClearStakes() + func (s *StateDB) CoinExists(symbol types.CoinSymbol) bool + func (s *StateDB) Commit() (root []byte, version int64, err error) + func (s *StateDB) CreateCandidate(rewardAddress types.Address, ownerAddress types.Address, pubkey types.Pubkey, ...) *stateCandidates + func (s *StateDB) CreateCoin(symbol types.CoinSymbol, name string, volume *big.Int, crr uint, ...) *stateCoin + func (s *StateDB) CreateMultisig(weights []uint, addresses []types.Address, threshold uint) types.Address + func (s *StateDB) CreateValidator(rewardAddress types.Address, pubkey types.Pubkey, commission uint, ...) *stateValidators + func (s *StateDB) DB() dbm.DB + func (s *StateDB) Delegate(sender types.Address, pubkey []byte, coin types.CoinSymbol, value *big.Int) + func (s *StateDB) EditCandidate(pubkey []byte, newRewardAddress types.Address, newOwnerAddress types.Address) + func (s *StateDB) Export(currentHeight uint64) types.AppState + func (s *StateDB) GetBalance(addr types.Address, coinSymbol types.CoinSymbol) *big.Int + func (s *StateDB) GetBalances(addr types.Address) Balances + func (s *StateDB) GetCandidates(count int, block int64) []Candidate + func (s *StateDB) GetCurrentMaxGas() uint64 + func (s *StateDB) GetMaxGas() uint64 + func (s *StateDB) GetNonce(addr types.Address) uint64 + func (s *StateDB) GetOrNewStateFrozenFunds(blockHeight uint64) *stateFrozenFund + func (s *StateDB) GetOrNewStateObject(addr types.Address) *stateAccount + func (s *StateDB) GetStateCandidate(key types.Pubkey) *Candidate + func (s *StateDB) GetStateCandidateByTmAddress(address [20]byte) *Candidate + func (s *StateDB) GetStateCandidates() (stateCandidates *stateCandidates) + func (s *StateDB) GetStateCoin(symbol types.CoinSymbol) *stateCoin + func (s *StateDB) GetStateFrozenFunds(blockHeight uint64) *stateFrozenFund + func (s *StateDB) GetStateValidators() (stateValidators *stateValidators) + func (s *StateDB) GetTotalSlashed() *big.Int + func (s *StateDB) Height() uint64 + func (s *StateDB) Import(appState types.AppState) + func (s *StateDB) IsCheckUsed(check *check.Check) bool + func (s *StateDB) IsDelegatorStakeSufficient(sender types.Address, pubKey []byte, coinSymbol types.CoinSymbol, ...) bool + func (s *StateDB) IsNewCandidateStakeSufficient(coinSymbol types.CoinSymbol, stake *big.Int) bool + func (s *StateDB) MarkStateCandidateDirty() + func (s *StateDB) MarkStateCoinDirty(symbol types.CoinSymbol) + func (s *StateDB) MarkStateFrozenFundsDirty(blockHeight uint64) + func (s *StateDB) MarkStateObjectDirty(addr types.Address) + func (s *StateDB) MarkStateValidatorsDirty() + func (s *StateDB) MultisigAccountExists(address types.Address) bool + func (s *StateDB) PayRewards() + func (s *StateDB) PunishByzantineValidator(address [20]byte) + func (s *StateDB) PunishFrozenFundsWithAddress(fromBlock uint64, toBlock uint64, address [20]byte) + func (s *StateDB) RecalculateTotalStakeValues() + func (s *StateDB) RemoveCurrentValidator(pubkey types.Pubkey) + func (s *StateDB) SanitizeCoin(symbol types.CoinSymbol) + func (s *StateDB) SetBalance(addr types.Address, coinSymbol types.CoinSymbol, amount *big.Int) + func (s *StateDB) SetCandidateOffline(pubkey []byte) + func (s *StateDB) SetCandidateOnline(pubkey []byte) + func (s *StateDB) SetMaxGas(maxGas uint64) + func (s *StateDB) SetNewValidators(candidates []Candidate) + func (s *StateDB) SetNonce(addr types.Address, nonce uint64) + func (s *StateDB) SetStateValidators(validators *stateValidators) + func (s *StateDB) SetValidatorAbsent(address [20]byte) + func (s *StateDB) SetValidatorPresent(address [20]byte) + func (s *StateDB) StakeExists(owner types.Address, pubKey []byte, coinSymbol types.CoinSymbol) bool + func (s *StateDB) SubBalance(addr types.Address, coinSymbol types.CoinSymbol, amount *big.Int) + func (s *StateDB) SubCoinReserve(symbol types.CoinSymbol, value *big.Int) + func (s *StateDB) SubCoinVolume(symbol types.CoinSymbol, value *big.Int) + func (s *StateDB) SubStake(sender types.Address, pubkey []byte, coin types.CoinSymbol, value *big.Int) + func (s *StateDB) UseCheck(check *check.Check) + type Tree interface + DeleteVersion func(version int64) error + Get func(key []byte) (index int64, value []byte) + GetImmutable func() *ImmutableTree + GetImmutableAtHeight func(version int64) (*ImmutableTree, error) + Hash func() []byte + Iterate func(fn func(key []byte, value []byte) bool) (stopped bool) + LazyLoadVersion func(targetVersion int64) (int64, error) + LoadVersion func(targetVersion int64) (int64, error) + Remove func(key []byte) ([]byte, bool) + SaveVersion func() ([]byte, int64, error) + Set func(key, value []byte) bool + Version func() int64 + type Validator struct + AbsentTimes *types.BitArray + AccumReward *big.Int + Commission uint + PubKey types.Pubkey + RewardAddress types.Address + TotalBipStake *big.Int + func (validator *Validator) CountAbsentTimes() int + func (validator *Validator) IsToDrop() bool + func (validator Validator) GetAddress() [20]byte + func (validator Validator) String() string + type Validators []Validator