Skip to content

Commit

Permalink
hotfix: add sleep for pool query
Browse files Browse the repository at this point in the history
  • Loading branch information
jbamlee committed Jun 5, 2024
1 parent eaf5c54 commit 1084cf6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/pkg/terraswap/databases/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"encoding/json"
"fmt"
"strings"
"time"

"github.com/pkg/errors"

Expand Down Expand Up @@ -161,7 +162,7 @@ func (t *terraswapGrpcCon) GetZeroPoolPairs(pairs []terraswap.Pair) (map[string]
}

func (t *terraswapGrpcCon) getPoolInfo(addr string) (*terraswap.PoolInfo, error) {

time.Sleep(1 * time.Second)
client := wasmtype.NewQueryClient(t.con)
res, err := client.SmartContractState(context.Background(), &wasmtype.QuerySmartContractStateRequest{
Address: addr,
Expand All @@ -185,7 +186,7 @@ func (t *terraswapGrpcCon) getPoolInfo(addr string) (*terraswap.PoolInfo, error)
}

func (t *terraswapGrpcCon) GetTokenInfo(tokenAddress string) (*terraswap.Token, error) {

time.Sleep(1 * time.Second)
client := wasmtype.NewQueryClient(t.con)
res, err := client.SmartContractState(context.Background(), &wasmtype.QuerySmartContractStateRequest{
Address: tokenAddress,
Expand Down

0 comments on commit 1084cf6

Please sign in to comment.