Skip to content
Snippets Groups Projects
Commit b234cffc authored by Jake Taylor's avatar Jake Taylor
Browse files

return str

parent 35b9bab9
No related branches found
No related tags found
2 merge requests!117Release,!87Add getprimagesb64
......@@ -24,23 +24,23 @@ func (c *Client) RegisterPreimageCallback(identity []byte, pin PreimageNotificat
c.api.GetStorage().GetEdge().AddUpdateCallback(iid, cb)
}
func (c *Client) GetPreimages(identity []byte) []byte {
func (c *Client) GetPreimages(identity []byte) string {
iid := &id.ID{}
copy(iid[:], identity)
list, exist := c.api.GetStorage().GetEdge().Get(iid)
if !exist {
jww.ERROR.Printf("Preimage for %s does not exist", iid.String())
return []byte{}
return ""
}
marshaled, err := json.Marshal(&list)
if err != nil {
jww.ERROR.Printf("Error marshaling preimages: %s", err.Error())
return []byte{}
return ""
}
jww.DEBUG.Printf("Preimages size: %v %v %d",
reflect.TypeOf(marshaled).Align(), unsafe.Sizeof(marshaled), len(marshaled))
return marshaled
return string(marshaled)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment