reliabilitymanager

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

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 int64, toBlock int64, 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