Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit b28cfac

Browse files
committed
fix dag formatting
1 parent a1c120d commit b28cfac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dag.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import (
88
files "github.com/whyrusleeping/go-multipart-files"
99
)
1010

11-
func (s *Shell) DagPut(data, kind string) (string, error) {
11+
func (s *Shell) DagPut(data, ienc, kind string) (string, error) {
1212
req := s.newRequest("dag/put")
1313
req.Opts = map[string]string{
14-
"input-enc": "hex",
14+
"input-enc": ienc,
1515
"format": kind,
1616
}
1717

@@ -34,13 +34,13 @@ func (s *Shell) DagPut(data, kind string) (string, error) {
3434

3535
var out struct {
3636
Cid struct {
37-
Ref string `json:"/"`
37+
Target string `json:"/"`
3838
}
3939
}
4040
err = json.NewDecoder(resp.Output).Decode(&out)
4141
if err != nil {
4242
return "", err
4343
}
4444

45-
return out.Cid.Ref, nil
45+
return out.Cid.Target, nil
4646
}

0 commit comments

Comments
 (0)