swarm/storage: make linter happy
This commit is contained in:
parent
d5837e84ff
commit
0ee44e796a
@ -42,15 +42,15 @@ func TestAfter(t *testing.T) {
|
|||||||
Level: 4,
|
Level: 4,
|
||||||
}
|
}
|
||||||
|
|
||||||
if b.After(a) != true {
|
if !b.After(a) {
|
||||||
t.Fatal("Expected 'after' to be true, got false")
|
t.Fatal("Expected 'after' to be true, got false")
|
||||||
}
|
}
|
||||||
|
|
||||||
if b.After(b) != false {
|
if b.After(b) {
|
||||||
t.Fatal("Expected 'after' to be false when both epochs are identical, got true")
|
t.Fatal("Expected 'after' to be false when both epochs are identical, got true")
|
||||||
}
|
}
|
||||||
|
|
||||||
if b.After(c) != true {
|
if !b.After(c) {
|
||||||
t.Fatal("Expected 'after' to be true when both epochs have the same time but the level is lower in the first one, but got false")
|
t.Fatal("Expected 'after' to be true when both epochs have the same time but the level is lower in the first one, but got false")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,9 +38,7 @@ func write(store Store, epoch lookup.Epoch, value *Data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func update(store Store, last lookup.Epoch, now uint64, value *Data) lookup.Epoch {
|
func update(store Store, last lookup.Epoch, now uint64, value *Data) lookup.Epoch {
|
||||||
var epoch lookup.Epoch
|
epoch := lookup.GetNextEpoch(last, now)
|
||||||
|
|
||||||
epoch = lookup.GetNextEpoch(last, now)
|
|
||||||
|
|
||||||
write(store, epoch, value)
|
write(store, epoch, value)
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ type Query struct {
|
|||||||
// useful to parse query strings
|
// useful to parse query strings
|
||||||
func (q *Query) FromValues(values Values) error {
|
func (q *Query) FromValues(values Values) error {
|
||||||
time, _ := strconv.ParseUint(values.Get("time"), 10, 64)
|
time, _ := strconv.ParseUint(values.Get("time"), 10, 64)
|
||||||
q.TimeLimit = uint64(time)
|
q.TimeLimit = time
|
||||||
|
|
||||||
level, _ := strconv.ParseUint(values.Get("hint.level"), 10, 32)
|
level, _ := strconv.ParseUint(values.Get("hint.level"), 10, 32)
|
||||||
q.Hint.Level = uint8(level)
|
q.Hint.Level = uint8(level)
|
||||||
|
Loading…
Reference in New Issue
Block a user