diff --git a/bindings/preimage.go b/bindings/preimage.go index 38c2bf715ffa8b89a6e9bf266f963e352ff25937..3117369675d4ec73c1454446bf056645be77c96d 100644 --- a/bindings/preimage.go +++ b/bindings/preimage.go @@ -36,3 +36,19 @@ func (c *Client) GetPreimages(identity []byte) (string, error) { return string(marshaled), err } + +// hack on getPreimages so it works on iOS per https://github.com/golang/go/issues/46893 +func (c *Client) GetPreimagesHack(dummy string, identity []byte) (string, error) { + + iid := &id.ID{} + copy(iid[:], identity) + + list, exist := c.api.GetStorage().GetEdge().Get(iid) + if !exist { + return "", errors.Errorf("Could not find a preimage list for %s", iid) + } + + marshaled, err := json.Marshal(&list) + + return string(marshaled), err +}