mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-29 03:05:49 +00:00
make the rest of the code compile
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ import (
|
||||
"github.com/tendermint/tendermint/crypto/tmhash"
|
||||
"github.com/tendermint/tendermint/internal/test/factory"
|
||||
tmrand "github.com/tendermint/tendermint/libs/rand"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
"github.com/tendermint/tendermint/pkg/light"
|
||||
"github.com/tendermint/tendermint/pkg/metadata"
|
||||
"github.com/tendermint/tendermint/version"
|
||||
)
|
||||
|
||||
@@ -183,16 +184,16 @@ func Test_Concurrency(t *testing.T) {
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
func randLightBlock(height int64) *types.LightBlock {
|
||||
func randLightBlock(height int64) *light.LightBlock {
|
||||
vals, _ := factory.RandValidatorSet(2, 1)
|
||||
return &types.LightBlock{
|
||||
SignedHeader: &types.SignedHeader{
|
||||
Header: &types.Header{
|
||||
return &light.LightBlock{
|
||||
SignedHeader: &metadata.SignedHeader{
|
||||
Header: &metadata.Header{
|
||||
Version: version.Consensus{Block: version.BlockProtocol, App: 0},
|
||||
ChainID: tmrand.Str(12),
|
||||
Height: height,
|
||||
Time: time.Now(),
|
||||
LastBlockID: types.BlockID{},
|
||||
LastBlockID: metadata.BlockID{},
|
||||
LastCommitHash: crypto.CRandBytes(tmhash.Size),
|
||||
DataHash: crypto.CRandBytes(tmhash.Size),
|
||||
ValidatorsHash: crypto.CRandBytes(tmhash.Size),
|
||||
@@ -203,7 +204,7 @@ func randLightBlock(height int64) *types.LightBlock {
|
||||
EvidenceHash: crypto.CRandBytes(tmhash.Size),
|
||||
ProposerAddress: crypto.CRandBytes(crypto.AddressSize),
|
||||
},
|
||||
Commit: &types.Commit{},
|
||||
Commit: &metadata.Commit{},
|
||||
},
|
||||
ValidatorSet: vals,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user