Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Nov 1, 2024
1 parent 0291350 commit e909eaf
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions server/json_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ import (
ethermint "github.com/evmos/ethermint/types"
)

const (
ServerStartTime = 5 * time.Second
MaxRetry = 6
)
const ServerStartTime = 5 * time.Second

type AppWithPendingTxStream interface {
RegisterPendingTxListener(listener ante.PendingTxListener)
Expand All @@ -64,20 +61,8 @@ func StartJSONRPC(
return nil, fmt.Errorf("client %T does not implement EventsClient", clientCtx.Client)
}

var rpcStream *stream.RPCStream
var err error
queryClient := rpctypes.NewQueryClient(clientCtx)
for i := 0; i < MaxRetry; i++ {
rpcStream, err = stream.NewRPCStreams(evtClient, logger, clientCtx.TxConfig.TxDecoder(), queryClient.ValidatorAccount)
if err == nil {
break
}
time.Sleep(time.Second)
}

if err != nil {
return nil, fmt.Errorf("failed to create rpc streams after %d attempts: %w", MaxRetry, err)
}
rpcStream := stream.NewRPCStreams(evtClient, logger, clientCtx.TxConfig.TxDecoder(), queryClient.ValidatorAccount)

app.RegisterPendingTxListener(rpcStream.ListenPendingTx)

Expand Down

0 comments on commit e909eaf

Please sign in to comment.