forked from TrueCloudLab/frostfs-node
[#955] chainbase: Fix rule chain unmarshalling
* Use correct way DecodeBytes instead unmarshalling by json. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>bugfix/namespace_require
parent
befbaf9d56
commit
c1a5b831b6
|
@ -2,7 +2,6 @@ package chainbase
|
|||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
|
@ -203,7 +202,7 @@ func (cs *boltLocalOverrideStorage) GetOverride(name chain.Name, target policyen
|
|||
}
|
||||
|
||||
c := &chain.Chain{}
|
||||
if err := json.Unmarshal(serializedChain, c); err != nil {
|
||||
if err := c.DecodeBytes(serializedChain); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c, nil
|
||||
|
@ -241,7 +240,7 @@ func (cs *boltLocalOverrideStorage) ListOverrides(name chain.Name, target policy
|
|||
chains := make([]*chain.Chain, 0, len(serializedChains))
|
||||
for _, serializedChain = range serializedChains {
|
||||
c := &chain.Chain{}
|
||||
if err := json.Unmarshal(serializedChain, c); err != nil {
|
||||
if err := c.DecodeBytes(serializedChain); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chains = append(chains, c)
|
||||
|
|
Loading…
Reference in New Issue