From 7d65c4606a7abc783a4b6d09af35824513b2856d Mon Sep 17 00:00:00 2001 From: josh <josh@elixxir.io> Date: Fri, 28 Jan 2022 10:50:08 -0800 Subject: [PATCH] Initialize auth storage in InitTestingSession --- storage/session.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/storage/session.go b/storage/session.go index e54ab01fb..9273e7590 100644 --- a/storage/session.go +++ b/storage/session.go @@ -14,6 +14,7 @@ import ( "gitlab.com/elixxir/client/storage/hostList" "gitlab.com/elixxir/client/storage/rounds" "gitlab.com/xx_network/primitives/rateLimiting" + "math/rand" "sync" "testing" "time" @@ -486,6 +487,19 @@ func InitTestingSession(i interface{}) *Session { s.hostList = hostList.NewStore(s.kv) + grp := cyclic.NewGroup(large.NewInt(173), large.NewInt(2)) + privKeys := make([]*cyclic.Int, 10) + pubKeys := make([]*cyclic.Int, 10) + for i := range privKeys { + privKeys[i] = grp.NewInt(rand.Int63n(172)) + pubKeys[i] = grp.ExpG(privKeys[i], grp.NewInt(1)) + } + + s.auth, err = auth.NewStore(s.kv, grp, privKeys) + if err != nil { + jww.FATAL.Panicf("Failed to create auth store: %v", err) + } + s.edgeCheck, err = edge.NewStore(s.kv, uid) if err != nil { jww.FATAL.Panicf("Failed to create new edge Store: %+v", err) -- GitLab