store

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 17 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 Store

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

func NewStore

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

func (Store) AddTxIndexer added in v1.3.0

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

func (*Store) Close added in v1.6.5

func (s *Store) Close()

func (Store) DeleteDIDEntry added in v1.7.0

func (s Store) DeleteDIDEntry(id string)

func (Store) DeleteHibernate added in v1.7.0

func (s Store) DeleteHibernate(val crypto.Address)

func (*Store) DeleteParcel

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

func (*Store) DeleteRequest

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

func (*Store) DeleteUsage

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

func (Store) DeleteVCEntry added in v1.9.0

func (s Store) DeleteVCEntry(vcId string)

func (*Store) DeleteVote added in v1.4.1

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

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) GetDIDEntry added in v1.7.0

func (s Store) GetDIDEntry(id string, committed bool) *types.DIDEntry

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) GetDraftForQuery added in v1.7.5

func (s *Store) GetDraftForQuery(draftID uint32, committed bool) *types.DraftForQuery

func (*Store) GetEffStake

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

func (Store) GetHibernate added in v1.7.0

func (s Store) GetHibernate(val crypto.Address, committed bool) *types.Hibernate

func (Store) GetHibernates added in v1.7.0

func (s Store) GetHibernates(committed bool) (vals []crypto.Address, hibs []*types.Hibernate)

func (*Store) GetHolderByValidator

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

func (*Store) GetLastDraftID added in v1.7.0

func (s *Store) GetLastDraftID() uint32

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) GetMerkleVersion added in v1.6.4

func (s *Store) GetMerkleVersion() int64

func (*Store) GetMissRunDB added in v1.7.0

func (s *Store) GetMissRunDB() tmdb.DB

func (*Store) GetParcel

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

func (*Store) GetProtocolVersion added in v1.8.0

func (s *Store) GetProtocolVersion(committed bool) uint64

func (*Store) GetRequest

func (s *Store) GetRequest(recipient 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(recipient 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) GetVCEntry added in v1.9.0

func (s Store) GetVCEntry(vcId string, committed bool) *types.VCEntry

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

func (s *Store) Load() (vers int64, err error)

Load the latest versioned tree from disk.

func (*Store) LoadVersion added in v1.6.1

func (s *Store) LoadVersion(version int64) (vers int64, err error)

func (*Store) LoosenLockedStakes added in v1.2.0

func (s *Store) LoosenLockedStakes(committed bool) []abci.Event

func (*Store) ProcessDraftVotes added in v1.4.1

func (s *Store) ProcessDraftVotes(
	latestDraftIDUint uint32,
	maxValidators uint64,
	quorumRate, passRate, refundRate float64,
	committed bool,
) []abci.Event

func (*Store) Purge

func (s *Store) Purge() error

func (*Store) RebuildIndex added in v1.6.5

func (s *Store) RebuildIndex()

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) SetDIDEntry added in v1.7.0

func (s Store) SetDIDEntry(id string, value *types.DIDEntry) 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) SetHibernate added in v1.7.0

func (s Store) SetHibernate(val crypto.Address, hib *types.Hibernate) 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) SetProtocolVersion added in v1.8.0

func (s *Store) SetProtocolVersion(version uint64) error

func (*Store) SetRequest

func (s *Store) SetRequest(recipient 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(recipient crypto.Address, parcelID []byte, value *types.Usage) error

func (Store) SetVCEntry added in v1.9.0

func (s Store) SetVCEntry(vcId string, value *types.VCEntry) 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