store

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func ConvIDFromHex added in v1.4.1

func ConvIDFromHex(IDHex tmbytes.HexBytes) (uint32, []byte, error)

func ConvIDFromStr added in v1.4.1

func ConvIDFromStr(raw string) ([]byte, error)

func ConvIDFromUint added in v1.4.1

func ConvIDFromUint(raw uint32) []byte

Types

type Address added in v1.3.0

type Address [crypto.AddressSize]byte

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 LazyValidators added in v1.3.0

type LazyValidators map[Address]int64

type Store

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

func NewStore

func NewStore(logger log.Logger, merkleDB, indexDB, incentiveDB, lazinessCounterDB tmdb.DB) (*Store, error)

func (Store) AddIncentiveRecord added in v1.2.0

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

func (Store) AddTxIndexer added in v1.3.0

func (s Store) AddTxIndexer(height int64, txs [][]byte)

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) DeleteVote added in v1.4.1

func (s Store) DeleteVote(draftID uint32, voter crypto.Address)

func (Store) GetAddressIncentiveRecords added in v1.2.0

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

func (Store) GetAppConfig added in v1.2.2

func (s Store) GetAppConfig() []byte

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) GetDraft added in v1.4.1

func (s Store) GetDraft(draftID uint32, committed bool) *types.Draft

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) GetLockedStakesWithHeight added in v1.3.0

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

func (Store) GetParcel

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

func (Store) GetRequest

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

func (Store) GetRequests added in v1.4.1

func (s Store) GetRequests(parcelID []byte, committed bool) []*types.RequestEx

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) GetStorage added in v1.4.1

func (s Store) GetStorage(id uint32, committed bool) *types.Storage

func (Store) GetTopStakes

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

func (Store) GetUDC added in v1.4.1

func (s Store) GetUDC(id uint32, committed bool) *types.UDC

func (Store) GetUDCBalance added in v1.4.1

func (s Store) GetUDCBalance(udc uint32,
	addr tm.Address, committed bool) *types.Currency

func (Store) GetUDCLock added in v1.4.1

func (s Store) GetUDCLock(udc uint32,
	addr tm.Address, committed bool) *types.Currency

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.Usage

func (Store) GetUsages added in v1.4.1

func (s Store) GetUsages(parcelID []byte, committed bool) []*types.UsageEx

func (Store) GetValidators

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

func (Store) GetVote added in v1.4.1

func (s Store) GetVote(draftID uint32, voter crypto.Address, committed bool) *types.Vote

func (Store) GetVotes added in v1.4.1

func (s Store) GetVotes(draftID uint32, committed bool) []*types.VoteInfo

func (Store) GroupCounterGetLazyValidators added in v1.3.0

func (s Store) GroupCounterGetLazyValidators() LazyValidators

func (Store) GroupCounterPurge added in v1.3.0

func (s Store) GroupCounterPurge()

func (Store) GroupCounterSet added in v1.3.0

func (s Store) GroupCounterSet(candidates LazyValidators)

Record map[Address]int64

func (Store) Load added in v1.3.0

func (s Store) Load() (int64, error)

Load the latest versioned tree from disk.

func (Store) LoosenLockedStakes added in v1.2.0

func (s Store) LoosenLockedStakes(committed bool)

func (Store) ProcessDraftVotes added in v1.4.1

func (s Store) ProcessDraftVotes(
	latestDraftIDUint uint32,
	maxValidators uint64,
	quorumRate, passRate, refundRate float64,
	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) SetAppConfig added in v1.2.2

func (s Store) SetAppConfig(b []byte) error

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) SetDraft added in v1.4.1

func (s Store) SetDraft(draftID uint32, value *types.Draft) error

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.Parcel) error

func (Store) SetRequest

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

func (Store) SetStorage added in v1.4.1

func (s Store) SetStorage(id uint32, sto *types.Storage) error

func (Store) SetUDC added in v1.4.1

func (s Store) SetUDC(id uint32, udc *types.UDC) error

func (Store) SetUDCBalance added in v1.4.1

func (s Store) SetUDCBalance(udc uint32,
	addr tm.Address, balance *types.Currency) error

func (Store) SetUDCLock added in v1.4.1

func (s Store) SetUDCLock(udc uint32,
	addr tm.Address, amount *types.Currency) 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.Usage) error

func (Store) SetVote added in v1.4.1

func (s Store) SetVote(draftID uint32, voter crypto.Address, value *types.Vote) error

func (Store) SlashStakes added in v1.3.0

func (s Store) SlashStakes(holder crypto.Address, amount types.Currency, committed bool)

func (Store) TxIndexerDelete added in v1.3.0

func (s Store) TxIndexerDelete(height int64)

func (Store) TxIndexerGetHash added in v1.3.0

func (s Store) TxIndexerGetHash(height int64) [][]byte

func (Store) TxIndexerGetHeight added in v1.3.0

func (s Store) TxIndexerGetHeight(txHash []byte) int64

func (Store) TxIndexerPurge added in v1.3.0

func (s Store) TxIndexerPurge()

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