mapper

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DelegationInvariant

func DelegationInvariant(module string) qtypes.Invariant

func Query

func Query(ctx context.Context, route []string, req abci.RequestQuery) (res []byte, err btypes.Error)

func RedelegationInvariant

func RedelegationInvariant(module string) qtypes.Invariant

func UnbondingInvariant

func UnbondingInvariant(module string) qtypes.Invariant

Types

type DelegationQueryResult

type DelegationQueryResult struct {
	DelegatorAddr   btypes.Address `json:"delegator_address"`
	OwnerAddr       btypes.Address `json:"owner_address"`
	ValidatorPubKey crypto.PubKey  `json:"validator_pub_key"`
	Amount          uint64         `json:"delegate_amount"`
	IsCompound      bool           `json:"is_compound"`
}

func NewDelegationQueryResult

func NewDelegationQueryResult(deleAddr, ownerAddr btypes.Address, valPubkey crypto.PubKey, amount uint64, compound bool) DelegationQueryResult

type Mapper

type Mapper struct {
	*mapper.BaseMapper
	// contains filtered or unexported fields
}

func GetMapper

func GetMapper(ctx context.Context) *Mapper

func NewMapper

func NewMapper() *Mapper

func (*Mapper) AddRedelegation

func (mapper *Mapper) AddRedelegation(redelegation types.RedelegationInfo)

func (*Mapper) AddRedelegations

func (mapper *Mapper) AddRedelegations(reDelegations []types.RedelegationInfo)

func (*Mapper) AddUnbondingDelegation

func (mapper *Mapper) AddUnbondingDelegation(unbonding types.UnbondingDelegationInfo)

func (*Mapper) AddUnbondingDelegations

func (mapper *Mapper) AddUnbondingDelegations(unbondingsAdd []types.UnbondingDelegationInfo)

func (*Mapper) AfterDelegationCreated

func (mapper *Mapper) AfterDelegationCreated(ctx context.Context, val btypes.Address, del btypes.Address)

func (*Mapper) AfterValidatorCreated

func (mapper *Mapper) AfterValidatorCreated(ctx context.Context, val btypes.Address)

func (*Mapper) AfterValidatorSlashed

func (mapper *Mapper) AfterValidatorSlashed(ctx context.Context, slashedTokes uint64)

func (*Mapper) BeforeDelegationModified

func (mapper *Mapper) BeforeDelegationModified(ctx context.Context, val btypes.Address, del btypes.Address, updateTokes uint64)

func (*Mapper) BeforeValidatorRemoved

func (mapper *Mapper) BeforeValidatorRemoved(ctx context.Context, val btypes.Address)

func (*Mapper) ChangeValidatorBondTokens

func (mapper *Mapper) ChangeValidatorBondTokens(validator types.Validator, updatedTokens uint64)

func (*Mapper) ClearValidatorVoteInfoInWindow

func (mapper *Mapper) ClearValidatorVoteInfoInWindow(valAddr btypes.Address)

func (*Mapper) Copy

func (mapper *Mapper) Copy() mapper.IMapper

func (*Mapper) CreateValidator

func (mapper *Mapper) CreateValidator(validator types.Validator)

func (*Mapper) DelDelegationInfo

func (mapper *Mapper) DelDelegationInfo(delAddr btypes.Address, valAddr btypes.Address)

func (*Mapper) DelValidatorVoteInfo

func (mapper *Mapper) DelValidatorVoteInfo(valAddr btypes.Address)

func (*Mapper) Delegate

func (mapper *Mapper) Delegate(ctx context.Context, info types.DelegationInfo, reDelegate bool)

func (*Mapper) Exists

func (mapper *Mapper) Exists(valAddress btypes.Address) bool

func (*Mapper) ExistsWithOwner

func (mapper *Mapper) ExistsWithOwner(owner btypes.Address) bool

func (*Mapper) GetActiveValidatorSet

func (mapper *Mapper) GetActiveValidatorSet(ascending bool) (validators []btypes.Address)

func (*Mapper) GetDelegationInfo

func (mapper *Mapper) GetDelegationInfo(delAddr btypes.Address, valAddr btypes.Address) (info types.DelegationInfo, exist bool)

func (*Mapper) GetDelegationsByValidator

func (mapper *Mapper) GetDelegationsByValidator(valAddr btypes.Address) (infos []types.DelegationInfo)

func (*Mapper) GetParams

func (mapper *Mapper) GetParams(ctx context.Context) types.Params

func (*Mapper) GetRedelegation

func (mapper *Mapper) GetRedelegation(height uint64, delAdd btypes.Address, valAddr btypes.Address) (reDelegation types.RedelegationInfo, exist bool)

func (*Mapper) GetRedelegationsByDelegator

func (mapper *Mapper) GetRedelegationsByDelegator(delegator btypes.Address) (redelegations []types.RedelegationInfo)

func (*Mapper) GetRedelegationsByFromValidator

func (mapper *Mapper) GetRedelegationsByFromValidator(validator btypes.Address) (redelegations []types.RedelegationInfo)

func (*Mapper) GetUnbondingDelegation

func (mapper *Mapper) GetUnbondingDelegation(height uint64, delAddr btypes.Address, valAddr btypes.Address) (unbonding types.UnbondingDelegationInfo, exist bool)

func (*Mapper) GetUnbondingDelegationsByDelegator

func (mapper *Mapper) GetUnbondingDelegationsByDelegator(delegator btypes.Address) (unbondings []types.UnbondingDelegationInfo)

func (*Mapper) GetUnbondingDelegationsByValidator

func (mapper *Mapper) GetUnbondingDelegationsByValidator(validator btypes.Address) (unbondings []types.UnbondingDelegationInfo)

func (*Mapper) GetValidator

func (mapper *Mapper) GetValidator(valAddress btypes.Address) (validator types.Validator, exists bool)

func (*Mapper) GetValidatorByOwner

func (mapper *Mapper) GetValidatorByOwner(owner btypes.Address) (validator types.Validator, exists bool)

func (*Mapper) GetValidatorVoteInfo

func (mapper *Mapper) GetValidatorVoteInfo(valAddr btypes.Address) (info types.ValidatorVoteInfo, exists bool)

func (*Mapper) GetVoteInfoInWindow

func (mapper *Mapper) GetVoteInfoInWindow(valAddr btypes.Address, index uint64) (vote bool)

func (*Mapper) IterateDelegationsInfo

func (mapper *Mapper) IterateDelegationsInfo(deleAddr btypes.Address, fn func(types.DelegationInfo))

func (*Mapper) IterateDelegationsValDeleAddr

func (mapper *Mapper) IterateDelegationsValDeleAddr(valAddr btypes.Address, fn func(btypes.Address, btypes.Address))

func (*Mapper) IterateRedelegationsInfo

func (mapper *Mapper) IterateRedelegationsInfo(fn func([]types.RedelegationInfo))

func (*Mapper) IterateUnbondingDelegations

func (mapper *Mapper) IterateUnbondingDelegations(fn func([]types.UnbondingDelegationInfo))

func (*Mapper) IterateValidators

func (mapper *Mapper) IterateValidators(fn func(types.Validator))

func (*Mapper) IterateVoteInWindowsInfos

func (mapper *Mapper) IterateVoteInWindowsInfos(fn func(uint64, btypes.Address, bool))

func (*Mapper) IterateVoteInfos

func (mapper *Mapper) IterateVoteInfos(fn func(btypes.Address, types.ValidatorVoteInfo))

func (*Mapper) IteratorInactiveValidator

func (mapper *Mapper) IteratorInactiveValidator(fromSecond, endSecond uint64) store.Iterator

func (*Mapper) IteratorInactiveValidatorByTime

func (mapper *Mapper) IteratorInactiveValidatorByTime(fromTime, endTime time.Time) store.Iterator

func (*Mapper) IteratorValidatorByVoterPower

func (mapper *Mapper) IteratorValidatorByVoterPower(ascending bool) store.Iterator

func (*Mapper) KickValidator

func (mapper *Mapper) KickValidator(valAddress btypes.Address) (validator types.Validator, ok bool)

func (*Mapper) MakeValidatorActive

func (mapper *Mapper) MakeValidatorActive(valAddress btypes.Address, addTokens uint64)

func (*Mapper) MakeValidatorInactive

func (mapper *Mapper) MakeValidatorInactive(valAddress btypes.Address, inactiveHeight uint64, inactiveTime time.Time, code types.InactiveCode)

func (*Mapper) ReDelegate

func (mapper *Mapper) ReDelegate(ctx context.Context, delegation types.DelegationInfo, info types.RedelegationInfo)

func (*Mapper) RemoveRedelegation

func (mapper *Mapper) RemoveRedelegation(height uint64, delAddr btypes.Address, valAddr btypes.Address)

func (*Mapper) RemoveUnbondingDelegation

func (mapper *Mapper) RemoveUnbondingDelegation(height uint64, delAddr btypes.Address, valAddr btypes.Address)

func (*Mapper) ResetValidatorVoteInfo

func (mapper *Mapper) ResetValidatorVoteInfo(valAddr btypes.Address, info types.ValidatorVoteInfo)

func (*Mapper) SetDelegationInfo

func (mapper *Mapper) SetDelegationInfo(info types.DelegationInfo)

func (*Mapper) SetHooks

func (mapper *Mapper) SetHooks(sh qtypes.Hooks)

func (*Mapper) SetParams

func (mapper *Mapper) SetParams(ctx context.Context, p types.Params)

func (*Mapper) SetRedelegation

func (mapper *Mapper) SetRedelegation(redelegation types.RedelegationInfo)

func (*Mapper) SetUnbondingDelegation

func (mapper *Mapper) SetUnbondingDelegation(unbonding types.UnbondingDelegationInfo)

func (*Mapper) SetValidatorVoteInfo

func (mapper *Mapper) SetValidatorVoteInfo(valAddr btypes.Address, info types.ValidatorVoteInfo)

func (*Mapper) SetVoteInfoInWindow

func (mapper *Mapper) SetVoteInfoInWindow(valAddr btypes.Address, index uint64, vote bool)

func (*Mapper) SlashRedelegations

func (mapper *Mapper) SlashRedelegations(valAddr btypes.Address, infractionHeight int64, fraction qtypes.Dec, maxSlash int64) int64

func (*Mapper) SlashUnbondings

func (mapper *Mapper) SlashUnbondings(valAddr btypes.Address, infractionHeight int64, fraction qtypes.Dec, maxSlash int64) int64

func (*Mapper) UnbondTokens

func (mapper *Mapper) UnbondTokens(ctx context.Context, info types.DelegationInfo, tokens uint64)

Jump to

Keyboard shortcuts

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