reliabilitymanager

package
v0.23.4 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DetectionVoteType = 0
	RevealVoteType    = 1
	CloseVoteType     = 2
)

Variables

View Source
var NoVoteDeadline = sdkerrors.New("Not Connected Error", 800, "No Connection To grpc server")

Functions

func BuildBaseVoteDataFromEvent

func BuildBaseVoteDataFromEvent(event terderminttypes.Event) (voteID string, voteDeadline uint64, err error)

func BuildRelayDataFromVoteParams

func BuildRelayDataFromVoteParams(voteParams *VoteParams) *pairingtypes.RelayPrivateData

Types

type ReliabilityManager

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

func NewReliabilityManager

func NewReliabilityManager(chainTracker *chaintracker.ChainTracker, txSender TxSender, publicAddress string, chainRouter chainlib.ChainRouter, chainParser chainlib.ChainParser) *ReliabilityManager

func (*ReliabilityManager) GetLatestBlockData

func (rm *ReliabilityManager) GetLatestBlockData(fromBlock, toBlock, specificBlock int64) (latestBlock int64, requestedHashes []*chaintracker.BlockStore, err error)

func (*ReliabilityManager) GetLatestBlockNum

func (rm *ReliabilityManager) GetLatestBlockNum() int64

func (*ReliabilityManager) VoteHandler

func (rm *ReliabilityManager) VoteHandler(voteParams *VoteParams, nodeHeight uint64) error

type TxSender

type TxSender interface {
	SendVoteReveal(voteID string, vote *VoteData) error
	SendVoteCommitment(voteID string, vote *VoteData) error
}

type VoteData

type VoteData struct {
	RelayDataHash []byte
	Nonce         int64
	CommitHash    []byte
}

type VoteParams

type VoteParams struct {
	CloseVote      bool
	ChainID        string
	ApiURL         string
	RequestData    []byte
	RequestBlock   uint64
	Voters         []string
	ConnectionType string
	ApiInterface   string
	VoteDeadline   uint64
	VoteID         string
	ParamsType     uint
	Metadata       []pairingtypes.Metadata
}

func BuildVoteParamsFromDetectionEvent

func BuildVoteParamsFromDetectionEvent(event terderminttypes.Event) (*VoteParams, error)

func (*VoteParams) GetCloseVote

func (vp *VoteParams) GetCloseVote() bool

Jump to

Keyboard shortcuts

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