diff --git a/observer/baseNodeProvider_test.go b/observer/baseNodeProvider_test.go index ad898604..a3926ffa 100644 --- a/observer/baseNodeProvider_test.go +++ b/observer/baseNodeProvider_test.go @@ -19,53 +19,32 @@ const configurationPath = "testdata/config.toml" func TestBaseNodeProvider_InvalidNodesConfiguration(t *testing.T) { t.Parallel() - t.Run("node both snapshotless and fallback", func(t *testing.T) { - t.Parallel() - - nodes := []*data.NodeData{ - { - Address: "addr", - ShardId: 0, - IsFallback: true, - IsSnapshotless: true, - }, - } - - bnp := baseNodeProvider{} - err := bnp.initNodes(nodes) - require.Equal(t, ErrObserverCannotBeBothFallbackAndSnapshotless, err) - }) - - t.Run("nodes in shard should not be snapshotless only", func(t *testing.T) { - t.Parallel() - - nodes := []*data.NodeData{ - { - Address: "addr0", - ShardId: 0, - IsSnapshotless: false, - }, - { - Address: "addr1", - ShardId: 0, - IsSnapshotless: true, - }, - { - Address: "addr2", - ShardId: 1, - IsSnapshotless: true, - }, - { - Address: "addr3", - ShardId: 1, - IsSnapshotless: true, - }, - } + nodes := []*data.NodeData{ + { + Address: "addr0", + ShardId: 0, + IsSnapshotless: false, + }, + { + Address: "addr1", + ShardId: 0, + IsSnapshotless: true, + }, + { + Address: "addr2", + ShardId: 1, + IsSnapshotless: true, + }, + { + Address: "addr3", + ShardId: 1, + IsSnapshotless: true, + }, + } - bnp := baseNodeProvider{} - err := bnp.initNodes(nodes) - require.Contains(t, err.Error(), "observers for shard 1 must include at least one historical (non-snapshotless) observer") - }) + bnp := baseNodeProvider{} + err := bnp.initNodes(nodes) + require.Contains(t, err.Error(), "observers for shard 1 must include at least one historical (non-snapshotless) observer") } func TestBaseNodeProvider_ReloadNodesDifferentNumberOfNewShard(t *testing.T) { diff --git a/observer/errors.go b/observer/errors.go index 5b7f8556..c4529012 100644 --- a/observer/errors.go +++ b/observer/errors.go @@ -7,9 +7,3 @@ var ErrEmptyObserversList = errors.New("empty observers list") // ErrShardNotAvailable signals that the specified shard ID cannot be found in internal maps var ErrShardNotAvailable = errors.New("the specified shard ID does not exist in proxy's configuration") - -// ErrWrongObserversConfiguration signals an invalid observers configuration -var ErrWrongObserversConfiguration = errors.New("wrong observers configuration") - -// ErrObserverCannotBeBothFallbackAndSnapshotless signals an invalid configuration for one of the configuration nodes -var ErrObserverCannotBeBothFallbackAndSnapshotless = errors.New("observer cannot be both fallback and snapshotless")