Files
tendermint/light/provider/provider.go
Jasmina Malicevic d68d25dcd5 light: return light client status on rpc /status (#7536)
*light: rpc /status returns status of light client ; code refactoring
 light: moved lightClientInfo into light.go, renamed String to ID
test/e2e: Return light client trusted height instead of SyncInfo trusted height
test/e2e/start.go: Not waiting for light client to catch up in tests. Removed querying of syncInfo in start if the node is a light node

* light: Removed call to primary /status. Added trustedPeriod to light info
* light/provider: added ID function to return IP of primary and witnesses
* light/provider/http/http_test: renamed String() to ID()
2022-01-20 14:53:20 +01:00

33 lines
977 B
Go

package provider
import (
"context"
"github.com/tendermint/tendermint/types"
)
//go:generate ../../scripts/mockery_generate.sh Provider
// Provider provides information for the light client to sync (verification
// happens in the client).
type Provider interface {
// LightBlock returns the LightBlock that corresponds to the given
// height.
//
// 0 - the latest.
// height must be >= 0.
//
// If the provider fails to fetch the LightBlock due to the IO or other
// issues, an error will be returned.
// If there's no LightBlock for the given height, ErrLightBlockNotFound
// error is returned.
LightBlock(ctx context.Context, height int64) (*types.LightBlock, error)
// ReportEvidence reports an evidence of misbehavior.
ReportEvidence(context.Context, types.Evidence) error
// Returns the ID of a provider. For RPC providers it returns the IP address of the client
// For p2p providers it returns a combination of NodeID and IP address
ID() string
}