Skip to content

Commit

Permalink
Fix the build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
zjshen14 committed Nov 28, 2018
1 parent e93e3bd commit 034d8f7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions blocksync/blocksync.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
type BlockSync interface {
lifecycle.StartStopper

TargetHeight() uint64
P2P() network.Overlay
ProcessSyncRequest(sender string, sync *pb.BlockSync) error
ProcessBlock(blk *blockchain.Block) error
Expand Down Expand Up @@ -75,6 +76,11 @@ func NewBlockSyncer(
return bs, nil
}

// TargetHeight returns the target height to sync to
func (bs *blockSyncer) TargetHeight() uint64 {
return bs.worker.targetHeight
}

// P2P returns the network overlay object
func (bs *blockSyncer) P2P() network.Overlay {
return bs.p2p
Expand Down
2 changes: 1 addition & 1 deletion blocksync/blocksync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ func TestBlockSyncerChaser(t *testing.T) {
require.NoError(chain.Start(ctx))
ap, err := actpool.NewActPool(chain, cfg.ActPool)
require.NoError(err)
bs, err := NewBlockSyncer(cfg, chain, ap, network.NewOverlay(cfg.Network))
bs, err := NewBlockSyncer(cfg, chain, ap, network.NewOverlay(&cfg.Network))
require.NoError(err)
require.NoError(bs.Start(ctx))

Expand Down
12 changes: 12 additions & 0 deletions test/mock/mock_blocksync/mock_blocksync.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 034d8f7

Please sign in to comment.