Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions code/go/0chain.net/core/transaction/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"fmt"
"io"
"net"
"net/http"
"net/url"

Expand Down Expand Up @@ -93,13 +92,6 @@ func makeSCRestAPICall(scAddress string, relativePath string, params map[string]
urls = append(urls, u+"?"+q.Encode())
}

transport := &http.Transport{
Dial: (&net.Dialer{
Timeout: resty.DefaultDialTimeout,
}).Dial,
TLSHandshakeTimeout: resty.DefaultDialTimeout,
}

header := map[string]string{
"Content-Type": "application/json; charset=utf-8",
"Access-Control-Allow-Origin": "*",
Expand All @@ -108,7 +100,7 @@ func makeSCRestAPICall(scAddress string, relativePath string, params map[string]
//leave first item for ErrTooLessConfirmation
var msgList = make([]string, 1, numSharders)

r := resty.New(transport, func(req *http.Request, resp *http.Response, respBody []byte, cancelFunc context.CancelFunc, err error) error {
r := resty.New(resty.WithHeader(header)).Then(func(req *http.Request, resp *http.Response, respBody []byte, cancelFunc context.CancelFunc, err error) error {
if err != nil { //network issue
msgList = append(msgList, err.Error())
return err
Expand Down Expand Up @@ -143,10 +135,7 @@ func makeSCRestAPICall(scAddress string, relativePath string, params map[string]
}

return nil
},
resty.WithTimeout(resty.DefaultRequestTimeout),
resty.WithRetry(resty.DefaultRetry),
resty.WithHeader(header))
})

for {
r.DoGet(context.TODO(), urls...)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.16

require (
github.com/0chain/errors v1.0.3
github.com/0chain/gosdk v1.7.3-0.20220302075118-819a9fe8d1da
github.com/0chain/gosdk v1.7.3-0.20220306071938-bb5b797cf02c
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/didip/tollbooth/v6 v6.1.2
github.com/go-ini/ini v1.55.0 // indirect
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM=
github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc=
github.com/0chain/gosdk v1.7.3-0.20220302075118-819a9fe8d1da h1:Mno3gifncwxsLEfkGUnsKqTvCDUbUioJXkYYH8Thw+8=
github.com/0chain/gosdk v1.7.3-0.20220302075118-819a9fe8d1da/go.mod h1:G/JUrqvT2WStxFbSpJKnU1Wt37GyatimoqPJfEE10bs=
github.com/0chain/gosdk v1.7.3-0.20220306071938-bb5b797cf02c h1:sskqXnQdJlMvAt0E9fdW3bI545nFKtUlxsye4W7NoRo=
github.com/0chain/gosdk v1.7.3-0.20220306071938-bb5b797cf02c/go.mod h1:JF2dfUrSfIGK599LuUn7BgqQAj7oJPw+CE5GVSr/qEE=
github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4=
github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc=
github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4=
Expand Down Expand Up @@ -825,7 +825,6 @@ github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssy
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down Expand Up @@ -878,7 +877,6 @@ github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/cors v1.8.0 h1:P2KMzcFwrPoSjkF1WLRPsp3UMLyql8L4v9hQpVeK5so=
github.com/rs/cors v1.8.0/go.mod h1:EBwu+T5AvHOcXwvZIkQFjUN6s8Czyqw12GL/Y0tUyRM=
Expand Down