Commit ec4cec0c authored by Mildred Ki'Lya's avatar Mildred Ki'Lya

Rename Decoded into DecodeProtobuf

This function work only with protocol buffer encoding. To make this clear,
rename the function.

License: MIT
Signed-off-by: default avatarMildred Ki'Lya <mildred-pub.git@mildred.fr>
parent 77c80001
......@@ -85,7 +85,7 @@ func (n *Node) Encoded(force bool) ([]byte, error) {
}
// Decoded decodes raw data and returns a new Node instance.
func Decoded(encoded []byte) (*Node, error) {
func DecodeProtobuf(encoded []byte) (*Node, error) {
n := new(Node)
err := n.unmarshal(encoded)
if err != nil {
......
......@@ -104,7 +104,7 @@ func (n *dagService) Get(ctx context.Context, k key.Key) (*Node, error) {
return nil, err
}
return Decoded(b.Data)
return DecodeProtobuf(b.Data)
}
// Remove deletes the given node and all of its children from the BlockService
......@@ -167,7 +167,7 @@ func (ds *dagService) GetMany(ctx context.Context, keys []key.Key) <-chan *NodeO
}
return
}
nd, err := Decoded(b.Data)
nd, err := DecodeProtobuf(b.Data)
if err != nil {
out <- &NodeOption{Err: err}
return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment