[#185] *: Use `storage.DeserializeValues` flag for search

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
enable-notary-in-public-chains
Pavel Karpy 2021-11-29 19:56:19 +03:00 committed by Alex Vanin
parent 23d9799e51
commit e6a33e8193
2 changed files with 4 additions and 6 deletions

View File

@ -744,10 +744,9 @@ func estimationKey(epoch int, cid []byte, key interop.PublicKey) []byte {
func getContainerSizeEstimation(ctx storage.Context, key, cid []byte) containerSizes { func getContainerSizeEstimation(ctx storage.Context, key, cid []byte) containerSizes {
var estimations []estimation var estimations []estimation
it := storage.Find(ctx, key, storage.ValuesOnly) it := storage.Find(ctx, key, storage.ValuesOnly|storage.DeserializeValues)
for iterator.Next(it) { for iterator.Next(it) {
rawEstimation := iterator.Value(it).([]byte) est := iterator.Value(it).(estimation)
est := std.Deserialize(rawEstimation).(estimation)
estimations = append(estimations, est) estimations = append(estimations, est)
} }

View File

@ -537,10 +537,9 @@ func filterNetmap(ctx storage.Context, st nodeState) []storageNode {
func getNetmapNodes(ctx storage.Context) []netmapNode { func getNetmapNodes(ctx storage.Context) []netmapNode {
result := []netmapNode{} result := []netmapNode{}
it := storage.Find(ctx, candidatePrefix, storage.ValuesOnly) it := storage.Find(ctx, candidatePrefix, storage.ValuesOnly|storage.DeserializeValues)
for iterator.Next(it) { for iterator.Next(it) {
rawNode := iterator.Value(it).([]byte) node := iterator.Value(it).(netmapNode)
node := std.Deserialize(rawNode).(netmapNode)
result = append(result, node) result = append(result, node)
} }