mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-19 18:05:32 +08:00
remove context from context
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
@ -114,7 +114,7 @@ It reads from stdin, and <key> is a base58 encoded multihash.
|
||||
cmds.FileArg("data", true, false, "The data to be stored as an IPFS block").EnableStdin(),
|
||||
},
|
||||
Run: func(req cmds.Request, res cmds.Response) {
|
||||
n, err := req.Context().GetNode()
|
||||
n, err := req.InvocContext().GetNode()
|
||||
if err != nil {
|
||||
res.SetError(err, cmds.ErrNormal)
|
||||
return
|
||||
@ -162,7 +162,7 @@ It reads from stdin, and <key> is a base58 encoded multihash.
|
||||
}
|
||||
|
||||
func getBlockForKey(req cmds.Request, skey string) (*blocks.Block, error) {
|
||||
n, err := req.Context().GetNode()
|
||||
n, err := req.InvocContext().GetNode()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -177,7 +177,7 @@ func getBlockForKey(req cmds.Request, skey string) (*blocks.Block, error) {
|
||||
}
|
||||
|
||||
k := key.Key(h)
|
||||
b, err := n.Blocks.GetBlock(req.Context().Context, k)
|
||||
b, err := n.Blocks.GetBlock(req.Context(), k)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user