reliabilitymanager

package
v4.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 18 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 ChainTrackerInf

type ChainTrackerInf interface {
	GetLatestBlockData(fromBlock int64, toBlock int64, specificBlock int64) (latestBlock int64, requestedHashes []*chaintracker.BlockStore, changeTime time.Time, err error)
	GetLatestBlockNum() (int64, time.Time)
}

type ReliabilityManager

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

func NewReliabilityManager

func NewReliabilityManager(chainTracker ChainTrackerInf, 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, changeTime time.Time, err error)

func (*ReliabilityManager) GetLatestBlockNum

func (rm *ReliabilityManager) GetLatestBlockNum() (int64, time.Time)

func (*ReliabilityManager) VoteHandler

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

type TxSender

type TxSender interface {
	SendVoteReveal(voteID string, vote *VoteData, specID string) error
	SendVoteCommitment(voteID string, vote *VoteData, specID string) 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