checkpointoracle

package
v0.0.0-...-42c68ef Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package checkpointoracle is a wrapper of checkpoint oracle contract with additional rules defined. This package can be used both in LES client or server side for offering oracle related APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckpointOracle

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

CheckpointOracle is responsible for offering the latest stable checkpoint generated and announced by the contract admins on-chain. The checkpoint can be verified by clients locally during the checkpoint syncing.

func New

New creates a checkpoint oracle handler with given configs and callback.

func (*CheckpointOracle) Contract

Contract returns the underlying raw checkpoint oracle contract.

func (*CheckpointOracle) IsRunning

func (oracle *CheckpointOracle) IsRunning() bool

IsRunning returns an indicator whether the oracle is running.

func (*CheckpointOracle) StableCheckpoint

func (oracle *CheckpointOracle) StableCheckpoint() (*params.TrustedCheckpoint, uint64)

StableCheckpoint returns the stable checkpoint which was generated by local indexers and announced by trusted signers.

func (*CheckpointOracle) Start

func (oracle *CheckpointOracle) Start(backend bind.ContractBackend)

Start binds the contract backend, initializes the oracle instance and marks the status as available.

func (*CheckpointOracle) VerifySigners

func (oracle *CheckpointOracle) VerifySigners(index uint64, hash [32]byte, signatures [][]byte) (bool, []common.Address)

VerifySigners recovers the signer addresses according to the signature and checks whether there are enough approvals to finalize the checkpoint.

Jump to

Keyboard shortcuts

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