Skip to content
Snippets Groups Projects
Commit 61f99c06 authored by Josh Brooks's avatar Josh Brooks
Browse files

Update test utils in round package

parent 4604ccac
No related branches found
No related tags found
No related merge requests found
......@@ -42,22 +42,28 @@ const ErrorGateway = "Error"
type mockMessageRetrievalComms struct {
testingSignature *testing.T
hosts map[string]*connect.Host
}
func (mmrc *mockMessageRetrievalComms) AddHost(hid *id.ID, address string, cert []byte, params connect.HostParams) (host *connect.Host, err error) {
host, err = connect.NewHost(hid, address, cert, params)
if err != nil {
return nil, err
}
mmrc.hosts[hid.String()] = host
return host, err
}
func (mmrc *mockMessageRetrievalComms) RemoveHost(hid *id.ID) {
return
}
func (mmrc *mockMessageRetrievalComms) GetHost(hostId *id.ID) (*connect.Host, bool) {
h, _ := connect.NewHost(hostId, "0.0.0.0", []byte(""), connect.HostParams{
MaxRetries: 0,
AuthEnabled: false,
})
return h, true
h, ok := mmrc.hosts[hostId.String()]
return h, ok
}
// Mock comm which returns differently based on the host ID
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment