Skip to content

Commit

Permalink
corrected ipfs pin/ls output
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan6sha committed Jan 17, 2024
1 parent 9404faf commit 25532eb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions blox/ipfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ import (

type (
pinListResp struct {
PinLsList struct {
Keys map[string]pinListKeysType `json:"Keys,omitempty"`
} `json:"PinLsList"`
Keys map[string]pinListKeysType `json:"Keys,omitempty"`
}
pinListKeysType struct {
Type string
Expand Down Expand Up @@ -121,7 +119,7 @@ func (p *Blox) ServeIpfsRpc() http.Handler {
}

var resp pinListResp
resp.PinLsList.Keys = make(map[string]pinListKeysType)
resp.Keys = make(map[string]pinListKeysType)
results, err := p.ds.Query(r.Context(), queryOptions)
if err != nil {
log.Errorw("failed to query datastore", "err", err)
Expand All @@ -146,7 +144,7 @@ func (p *Blox) ServeIpfsRpc() http.Handler {
continue
}

resp.PinLsList.Keys[c.String()] = pinListKeysType{Type: "fx"} //TODO: what should the type be?
resp.Keys[c.String()] = pinListKeysType{Type: "recursive"}
} else {
log.Debugw("key too short to be a valid CID", "keyBytes", keyBytes)
}
Expand Down

0 comments on commit 25532eb

Please sign in to comment.