From 9c2e9bab14470e2416cf4eeaf83357c384280827 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Fri, 18 Mar 2016 02:42:53 +0000 Subject: [PATCH] cosmetic(ish) refactor --- ipam/testutils_test.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ipam/testutils_test.go b/ipam/testutils_test.go index 40dcf634..32de500b 100644 --- a/ipam/testutils_test.go +++ b/ipam/testutils_test.go @@ -139,12 +139,15 @@ func makeAllocator(name string, cidrStr string, quorum uint) (*Allocator, addres panic(err) } - config := Config{peername, mesh.PeerUID(rand.Int63()), - "nick-" + name, cidr.Range(), quorum, new(mockDB), func(mesh.PeerName) bool { return true }} - - alloc := NewAllocator(config) - - return alloc, cidr + return NewAllocator(Config{ + OurName: peername, + OurUID: mesh.PeerUID(rand.Int63()), + OurNickname: "nick-" + name, + Universe: cidr.Range(), + Quorum: quorum, + Db: new(mockDB), + IsKnownPeer: func(mesh.PeerName) bool { return true }, + }), cidr } func makeAllocatorWithMockGossip(t *testing.T, name string, universeCIDR string, quorum uint) (*Allocator, address.CIDR) {