voteprocessor

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsensusHook

type ConsensusHook[Source comparable, Data comparable] func(sdk.Context, map[Source]Data)

type DataConverter

type DataConverter[Source comparable, Data comparable] func(string) (Source, Data, error)

type DataWithVoter

type DataWithVoter[T any] struct {
	Data  T
	Voter sdk.ValAddress
}

type DataWithWeight

type DataWithWeight[T any] struct {
	Data   T
	Weight int64
}

type IVoteProcessor

type IVoteProcessor interface {
	TallyVotes(ctx sdk.Context, validatorClaimMap map[string]types.Claim)
}

func NewSettlusVoteProcessors

func NewSettlusVoteProcessors(keeper keeper.Keeper, aggregateVotes []types.AggregateVote, thresholdVotes math.Int) []IVoteProcessor

type VoteProcessor

type VoteProcessor[Source comparable, Data comparable] struct {
	// contains filtered or unexported fields
}

func NewBlockVoteProcessor

func NewBlockVoteProcessor(
	onConsensus func(ctx sdk.Context, voteData map[string]types.BlockData),
	aggregateVotes []types.AggregateVote,
	thresholdVotes math.Int) *VoteProcessor[string, types.BlockData]

func NewOwnershipVoteProcessor

func NewOwnershipVoteProcessor(
	onConsensus func(ctx sdk.Context, voteData map[ctypes.Nft]ctypes.HexAddressString),
	aggregateVotes []types.AggregateVote,
	thresholdVotes math.Int) *VoteProcessor[ctypes.Nft, ctypes.HexAddressString]

func (*VoteProcessor[Source, Data]) TallyVotes

func (vp *VoteProcessor[Source, Data]) TallyVotes(ctx sdk.Context, validatorClaimMap map[string]types.Claim)

Jump to

Keyboard shortcuts

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