store

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// division by 2 is for safeguarding. tendermint code is not so safe.
	MaxTotalVotingPower = tm.MaxTotalVotingPower / 2
)

Variables

This section is empty.

Functions

func NewDBProxy added in v1.2.0

func NewDBProxy(name, dir string) (tmdb.DB, error)

Types

type IncentiveInfo added in v1.2.0

type IncentiveInfo struct {
	BlockHeight int64           `json:"block_height"`
	Address     crypto.Address  `json:"address"`
	Amount      *types.Currency `json:"amount"`
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(merkleDB, indexDB, incentiveDB tmdb.DB) *Store

func (Store) AddIncentiveRecord added in v1.2.0

func (s Store) AddIncentiveRecord(height int64, address crypto.Address, amount *types.Currency) error

func (Store) DeleteParcel

func (s Store) DeleteParcel(parcelID []byte)

func (Store) DeleteRequest

func (s Store) DeleteRequest(buyer crypto.Address, parcelID []byte)

func (Store) DeleteUsage

func (s Store) DeleteUsage(buyer crypto.Address, parcelID []byte)

func (Store) GetAddressIncentiveRecords added in v1.2.0

func (s Store) GetAddressIncentiveRecords(address crypto.Address) []IncentiveInfo

func (Store) GetBalance

func (s Store) GetBalance(addr tm.Address, committed bool) *types.Currency

func (Store) GetBlockIncentiveRecords added in v1.2.0

func (s Store) GetBlockIncentiveRecords(height int64) []IncentiveInfo

func (Store) GetDelegate

func (s Store) GetDelegate(holder crypto.Address, committed bool) *types.Delegate

func (Store) GetDelegateEx added in v1.1.0

func (s Store) GetDelegateEx(holder crypto.Address, committed bool) *types.DelegateEx

func (Store) GetDelegatesByDelegatee added in v1.1.0

func (s Store) GetDelegatesByDelegatee(delegatee crypto.Address, committed bool) []*types.DelegateEx

func (Store) GetEffStake

func (s Store) GetEffStake(delegatee crypto.Address, committed bool) *types.Stake

func (Store) GetHolderByValidator

func (s Store) GetHolderByValidator(addr crypto.Address, committed bool) []byte

func (Store) GetIncentiveRecord added in v1.2.0

func (s Store) GetIncentiveRecord(height int64, address crypto.Address) IncentiveInfo

func (Store) GetLockedStake added in v1.2.0

func (s Store) GetLockedStake(holder crypto.Address, height int64, committed bool) *types.Stake

func (Store) GetLockedStakes added in v1.2.0

func (s Store) GetLockedStakes(holder crypto.Address, committed bool) []*types.Stake

func (Store) GetParcel

func (s Store) GetParcel(parcelID []byte, committed bool) *types.ParcelValue

func (Store) GetRequest

func (s Store) GetRequest(buyer crypto.Address, parcelID []byte, committed bool) *types.RequestValue

func (Store) GetStake

func (s Store) GetStake(holder crypto.Address, committed bool) *types.Stake

func (Store) GetStakeByValidator

func (s Store) GetStakeByValidator(addr crypto.Address, committed bool) *types.Stake

func (Store) GetTopStakes

func (s Store) GetTopStakes(max uint64, committed bool) []*types.Stake

func (Store) GetUnlockedStake added in v1.2.0

func (s Store) GetUnlockedStake(holder crypto.Address, committed bool) *types.Stake

func (Store) GetUsage

func (s Store) GetUsage(buyer crypto.Address, parcelID []byte, committed bool) *types.UsageValue

func (Store) GetValidators

func (s Store) GetValidators(max uint64, committed bool) abci.ValidatorUpdates

func (Store) LoosenLockedStakes added in v1.2.0

func (s Store) LoosenLockedStakes(committed bool)

func (Store) Purge

func (s Store) Purge() error

func (Store) Root added in v1.2.0

func (s Store) Root() []byte

func (Store) Save added in v1.2.0

func (s Store) Save() ([]byte, int64, error)

working tree >> saved tree

func (Store) SetBalance

func (s Store) SetBalance(addr tm.Address, balance *types.Currency) error

func (Store) SetBalanceUint64

func (s Store) SetBalanceUint64(addr tm.Address, balance uint64) error

func (Store) SetDelegate

func (s Store) SetDelegate(holder crypto.Address, delegate *types.Delegate) error

Update data on stateDB, indexDelegator, indexEffStake

func (Store) SetLockedStake added in v1.2.0

func (s Store) SetLockedStake(holder crypto.Address, stake *types.Stake, height int64) error

SetLockedStake stores a stake locked at *height*. The stake's height is decremented each time when LoosenLockedStakes is called.

func (Store) SetParcel

func (s Store) SetParcel(parcelID []byte, value *types.ParcelValue) error

func (Store) SetRequest

func (s Store) SetRequest(buyer crypto.Address, parcelID []byte, value *types.RequestValue) error

func (Store) SetUnlockedStake added in v1.2.0

func (s Store) SetUnlockedStake(holder crypto.Address, stake *types.Stake) error

func (Store) SetUsage

func (s Store) SetUsage(buyer crypto.Address, parcelID []byte, value *types.UsageValue) error

func (Store) UnlockStakes added in v1.2.0

func (s Store) UnlockStakes(holder crypto.Address, height int64, committed bool)

func (Store) Verify added in v1.2.0

func (s Store) Verify(key []byte) (bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL