Skip to content

Commit

Permalink
lint code;
Browse files Browse the repository at this point in the history
Signed-off-by: tcar <tcar121293@gmail.com>
  • Loading branch information
tcar121293 committed Jul 24, 2024
1 parent 8032c0e commit 6538344
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions chains/btc/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"math/big"
"mime/multipart"
"net/http"
Expand Down Expand Up @@ -451,16 +451,17 @@ func (e *Executor) storeProposalsStatus(props []*BtcTransferProposal, status sto
}

func uploadToIpfs(data []byte) (string, error) {
// url := "https://api.pinata.cloud/pinning/pinFileToIPFS"

// Create a new multipart form file
body := new(bytes.Buffer)
writer := multipart.NewWriter(body)
part, err := writer.CreateFormFile("file", "metadata.json")
if err != nil {
return "", err
}
part.Write(data)
_, err = part.Write(data)
if err != nil {
return "", err
}
writer.Close()

// Create a new request
Expand All @@ -482,7 +483,7 @@ func uploadToIpfs(data []byte) (string, error) {
defer resp.Body.Close()

// Read the response
respBody, err := ioutil.ReadAll(resp.Body)
respBody, err := io.ReadAll(resp.Body)
if err != nil {
return "", err
}
Expand Down

0 comments on commit 6538344

Please sign in to comment.