fix compile batch 1

This commit is contained in:
tycho garen
2021-08-23 16:10:50 -04:00
parent 508b7f9758
commit 09a47a1bbf
46 changed files with 404 additions and 393 deletions
+4 -3
View File
@@ -3,7 +3,8 @@ package provider
import (
"context"
"github.com/tendermint/tendermint/types"
"github.com/tendermint/tendermint/pkg/evidence"
"github.com/tendermint/tendermint/pkg/light"
)
//go:generate ../../scripts/mockery_generate.sh Provider
@@ -21,8 +22,8 @@ type Provider interface {
// 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)
LightBlock(ctx context.Context, height int64) (*light.LightBlock, error)
// ReportEvidence reports an evidence of misbehavior.
ReportEvidence(context.Context, types.Evidence) error
ReportEvidence(context.Context, evidence.Evidence) error
}
+6 -6
View File
@@ -9,8 +9,8 @@ import (
tmsync "github.com/tendermint/tendermint/internal/libs/sync"
"github.com/tendermint/tendermint/light/store"
"github.com/tendermint/tendermint/pkg/light"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/tendermint/tendermint/types"
)
const (
@@ -45,7 +45,7 @@ func New(db dbm.DB) store.Store {
// SaveLightBlock persists LightBlock to the db.
//
// Safe for concurrent use by multiple goroutines.
func (s *dbs) SaveLightBlock(lb *types.LightBlock) error {
func (s *dbs) SaveLightBlock(lb *light.LightBlock) error {
if lb.Height <= 0 {
panic("negative or zero height")
}
@@ -110,7 +110,7 @@ func (s *dbs) DeleteLightBlock(height int64) error {
// LightBlock retrieves the LightBlock at the given height.
//
// Safe for concurrent use by multiple goroutines.
func (s *dbs) LightBlock(height int64) (*types.LightBlock, error) {
func (s *dbs) LightBlock(height int64) (*light.LightBlock, error) {
if height <= 0 {
panic("negative or zero height")
}
@@ -129,7 +129,7 @@ func (s *dbs) LightBlock(height int64) (*types.LightBlock, error) {
return nil, fmt.Errorf("unmarshal error: %w", err)
}
lightBlock, err := types.LightBlockFromProto(&lbpb)
lightBlock, err := light.LightBlockFromProto(&lbpb)
if err != nil {
return nil, fmt.Errorf("proto conversion error: %w", err)
}
@@ -181,7 +181,7 @@ func (s *dbs) FirstLightBlockHeight() (int64, error) {
// the given height. It returns ErrLightBlockNotFound if no such block exists.
//
// Safe for concurrent use by multiple goroutines.
func (s *dbs) LightBlockBefore(height int64) (*types.LightBlock, error) {
func (s *dbs) LightBlockBefore(height int64) (*light.LightBlock, error) {
if height <= 0 {
panic("negative or zero height")
}
@@ -202,7 +202,7 @@ func (s *dbs) LightBlockBefore(height int64) (*types.LightBlock, error) {
return nil, fmt.Errorf("unmarshal error: %w", err)
}
lightBlock, err := types.LightBlockFromProto(&lbpb)
lightBlock, err := light.LightBlockFromProto(&lbpb)
if err != nil {
return nil, fmt.Errorf("proto conversion error: %w", err)
}
+6 -4
View File
@@ -1,6 +1,8 @@
package store
import "github.com/tendermint/tendermint/types"
import (
"github.com/tendermint/tendermint/pkg/light"
)
// Store is anything that can persistently store headers.
type Store interface {
@@ -8,7 +10,7 @@ type Store interface {
// ValidatorSet (h: sh.Height).
//
// height must be > 0.
SaveLightBlock(lb *types.LightBlock) error
SaveLightBlock(lb *light.LightBlock) error
// DeleteSignedHeaderAndValidatorSet deletes SignedHeader (h: height) and
// ValidatorSet (h: height).
@@ -22,7 +24,7 @@ type Store interface {
// height must be > 0.
//
// If LightBlock is not found, ErrLightBlockNotFound is returned.
LightBlock(height int64) (*types.LightBlock, error)
LightBlock(height int64) (*light.LightBlock, error)
// LastLightBlockHeight returns the last (newest) LightBlock height.
//
@@ -37,7 +39,7 @@ type Store interface {
// LightBlockBefore returns the LightBlock before a certain height.
//
// height must be > 0 && <= LastLightBlockHeight.
LightBlockBefore(height int64) (*types.LightBlock, error)
LightBlockBefore(height int64) (*light.LightBlock, error)
// Prune removes headers & the associated validator sets when Store reaches a
// defined size (number of header & validator set pairs).