Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service/block: Remove block fetching capability from BlockService #277

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG-PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Month, DD, YYYY
### IMPROVEMENTS

- [go package] (Link to PR) Description @username
- [services/block: Remove block fetching capability from `BlockService`](https://github.com/celestiaorg/celestia-node/pull/277) [@renaynay](https://github.com/renaynay)

### BUG FIXES

Expand Down
2 changes: 1 addition & 1 deletion node/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func lightComponents(cfg *Config, repo Repository) fx.Option {
)
}

// fullComponents keeps all the components as DI options required to built a Full Node.
// fullComponents keeps all the components as DI options required to build a Full Node.
func fullComponents(cfg *Config, repo Repository) fx.Option {
return fx.Options(
baseComponents(cfg, repo),
Expand Down
21 changes: 0 additions & 21 deletions node/full_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ func TestFull_P2P_Streams(t *testing.T) {

func TestFull_WithRemoteCore(t *testing.T) {
// TODO(@Wondertan): Fix core
t.Skip("Skip until we fix core")

repo := MockRepository(t, DefaultConfig(Full))
remoteCore, protocol, ip := core.StartRemoteCore()
Expand All @@ -126,26 +125,6 @@ func TestFull_WithRemoteCore(t *testing.T) {
require.NoError(t, err)
}

func TestFull_WithRemoteCoreFailed(t *testing.T) {
repo := MockRepository(t, DefaultConfig(Full))
remoteCore, protocol, ip := core.StartRemoteCore()
require.NotNil(t, remoteCore)
assert.True(t, remoteCore.IsRunning())

node, err := New(Full, repo, WithRemoteCore(protocol, ip))
require.NoError(t, err)
require.NotNil(t, node)

ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)

err = node.CoreClient.Stop()
require.NoError(t, err)

err = node.Start(ctx)
require.Error(t, err, "node: failed to start: client not running")
}

func TestFull_NotPanicWithNilOpts(t *testing.T) {
repo := MockRepository(t, DefaultConfig(Full))
node, err := New(Full, repo, nil)
Expand Down
5 changes: 1 addition & 4 deletions node/services/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
pubsub "github.com/libp2p/go-libp2p-pubsub"
"go.uber.org/fx"

"github.com/celestiaorg/celestia-node/core"
"github.com/celestiaorg/celestia-node/das"
"github.com/celestiaorg/celestia-node/node/fxutil"
"github.com/celestiaorg/celestia-node/service/block"
Expand Down Expand Up @@ -78,11 +77,9 @@ func HeaderStore(ds datastore.Batching) (header.Store, error) {
// BlockService constructs new block.Service.
func BlockService(
lc fx.Lifecycle,
fetcher *core.BlockFetcher,
store ipld.DAGService,
broadcaster header.Broadcaster,
) *block.Service {
service := block.NewBlockService(fetcher, store, broadcaster)
service := block.NewBlockService(store)
lc.Append(fx.Hook{
OnStart: service.Start,
OnStop: service.Stop,
Expand Down
29 changes: 0 additions & 29 deletions service/block/erasure.go

This file was deleted.

105 changes: 0 additions & 105 deletions service/block/event.go

This file was deleted.

Loading