Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
b60c9690
Commit
b60c9690
authored
4 years ago
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Integration UncheckedRoundStore with session object
parent
0a1e1fa3
No related branches found
No related tags found
1 merge request
!23
Release
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
storage/session.go
+17
-0
17 additions, 0 deletions
storage/session.go
with
17 additions
and
0 deletions
storage/session.go
+
17
−
0
View file @
b60c9690
...
...
@@ -10,6 +10,7 @@
package
storage
import
(
"gitlab.com/elixxir/client/storage/rounds"
"sync"
"testing"
...
...
@@ -62,6 +63,7 @@ type Session struct {
garbledMessages
*
utility
.
MeteredCmixMessageBuffer
reception
*
reception
.
Store
clientVersion
*
clientVersion
.
Store
uncheckedRounds
*
rounds
.
UncheckedRoundStore
}
// Initialize a new Session object
...
...
@@ -141,6 +143,10 @@ func New(baseDir, password string, u userInterface.User, currentVersion version.
return
nil
,
errors
.
WithMessage
(
err
,
"Failed to create client version store."
)
}
s
.
uncheckedRounds
,
err
=
rounds
.
NewUncheckedStore
(
s
.
kv
)
if
err
!=
nil
{
return
nil
,
errors
.
WithMessage
(
err
,
"Failed to create unchecked round store"
)
}
return
s
,
nil
}
...
...
@@ -212,6 +218,11 @@ func Load(baseDir, password string, currentVersion version.Version,
s
.
reception
=
reception
.
LoadStore
(
s
.
kv
)
s
.
uncheckedRounds
,
err
=
rounds
.
LoadUncheckedStore
(
s
.
kv
)
if
err
!=
nil
{
return
nil
,
errors
.
WithMessage
(
err
,
"Failed to load unchecked round store"
)
}
return
s
,
nil
}
...
...
@@ -282,6 +293,12 @@ func (s *Session) Partition() *partition.Store {
return
s
.
partition
}
func
(
s
*
Session
)
UncheckedRounds
()
*
rounds
.
UncheckedRoundStore
{
s
.
mux
.
RLock
()
defer
s
.
mux
.
RUnlock
()
return
s
.
uncheckedRounds
}
// Get an object from the session
func
(
s
*
Session
)
Get
(
key
string
)
(
*
versioned
.
Object
,
error
)
{
return
s
.
kv
.
Get
(
key
,
currentSessionVersion
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment