Skip to content

Commit

Permalink
fix: upgrade retry version
Browse files Browse the repository at this point in the history
  • Loading branch information
sherpalden committed Feb 11, 2025
1 parent 771aaa9 commit 6b21235
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.22

require (
github.com/CosmWasm/wasmd v0.52.0
github.com/avast/retry-go/v4 v4.6.0
github.com/cometbft/cometbft v0.38.10
github.com/coming-chat/go-sui/v2 v2.0.1
github.com/cosmos/cosmos-sdk v0.50.8
Expand All @@ -26,7 +27,6 @@ require (
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d
go.uber.org/zap v1.27.0
golang.org/x/sync v0.7.0
google.golang.org/grpc v1.64.0
gopkg.in/yaml.v3 v3.0.1

)
Expand All @@ -39,7 +39,6 @@ require (
github.com/CosmWasm/wasmvm/v2 v2.1.0 // indirect
github.com/VictoriaMetrics/fastcache v1.12.2 // indirect
github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect
github.com/avast/retry-go v3.0.0+incompatible // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.9 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.0 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
Expand Down Expand Up @@ -129,6 +128,7 @@ require (
golang.org/x/net v0.26.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/grpc v1.64.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
Expand Down Expand Up @@ -289,7 +289,7 @@ require (
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/crypto v0.25.0
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/term v0.22.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A=
github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0=
github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY=
github.com/avast/retry-go/v4 v4.6.0 h1:K9xNA+KeB8HHc2aWFuLb25Offp+0iVRXEvFx8IinRJA=
github.com/avast/retry-go/v4 v4.6.0/go.mod h1:gvWlPhBVsvBbLkVGDg/KwvBv0bEkCOLRRSHKIr2PyOE=
github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU=
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
Expand Down
17 changes: 6 additions & 11 deletions relayer/chains/solana/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"io"
"time"

"github.com/avast/retry-go"
"github.com/avast/retry-go/v4"
"github.com/gagliardetto/solana-go"
solrpc "github.com/gagliardetto/solana-go/rpc"
"github.com/near/borsh-go"
Expand Down Expand Up @@ -268,15 +268,9 @@ func (cl Client) GetTransaction(
signature solana.Signature,
opts *solrpc.GetTransactionOpts,
) (*solrpc.GetTransactionResult, error) {
var tx *solrpc.GetTransactionResult
if err := retry.Do(
func() error {
txn, err := cl.rpc.GetTransaction(ctx, signature, opts)
if err != nil {
return err
}
tx = txn
return nil
tx, err := retry.DoWithData(
func() (*solrpc.GetTransactionResult, error) {
return cl.rpc.GetTransaction(ctx, signature, opts)
},
retry.Attempts(10),
retry.Delay(3*time.Second),
Expand All @@ -285,7 +279,8 @@ func (cl Client) GetTransaction(
}),
retry.LastErrorOnly(true),
retry.Context(ctx),
); err != nil {
)
if err != nil {
return nil, err
}
return tx, nil
Expand Down

0 comments on commit 6b21235

Please sign in to comment.