Skip to content
Snippets Groups Projects
Commit 7f900285 authored by Jono Wenger's avatar Jono Wenger
Browse files

Remove reception storage from single.NewManager

parent 4b97f64a
No related branches found
No related tags found
No related merge requests found
...@@ -72,7 +72,7 @@ var singleCmd = &cobra.Command{ ...@@ -72,7 +72,7 @@ var singleCmd = &cobra.Command{
waitUntilConnected(connected) waitUntilConnected(connected)
// Make single-use manager and start receiving process // Make single-use manager and start receiving process
singleMng := single.NewManager(client, client.GetStorage().Reception()) singleMng := single.NewManager(client)
// Register the callback // Register the callback
callbackChan := make(chan responseCallbackChan) callbackChan := make(chan responseCallbackChan)
......
...@@ -50,7 +50,11 @@ type Manager struct { ...@@ -50,7 +50,11 @@ type Manager struct {
} }
// NewManager creates a new single-use communication manager. // NewManager creates a new single-use communication manager.
func NewManager(client *api.Client, reception *reception.Store) *Manager { func NewManager(client *api.Client) *Manager {
return newManager(client, client.GetStorage().Reception())
}
func newManager(client *api.Client, reception *reception.Store) *Manager {
return &Manager{ return &Manager{
client: client, client: client,
store: client.GetStorage(), store: client.GetStorage(),
......
...@@ -39,13 +39,13 @@ import ( ...@@ -39,13 +39,13 @@ import (
) )
// Happy path. // Happy path.
func TestNewManager(t *testing.T) { func Test_newManager(t *testing.T) {
client := &api.Client{} client := &api.Client{}
e := &Manager{ e := &Manager{
client: client, client: client,
p: newPending(), p: newPending(),
} }
m := NewManager(client, reception.NewStore(versioned.NewKV(make(ekv.Memstore)))) m := newManager(client, &reception.Store{})
if e.client != m.client || e.store != m.store || e.net != m.net || if e.client != m.client || e.store != m.store || e.net != m.net ||
e.rng != m.rng || !reflect.DeepEqual(e.p, m.p) { e.rng != m.rng || !reflect.DeepEqual(e.p, m.p) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment