Skip to content

Commit

Permalink
chore: rename url flag into rpc-endpoint like cast
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct committed Oct 18, 2023
1 parent d1710cf commit 520bcf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cmd/loadtest/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type (
}
loadTestParams struct {
// inputs
URL *url.URL
RPCEndpoint *url.URL
Requests *int64
Concurrency *int64
BatchSize *uint64
Expand Down Expand Up @@ -163,12 +163,12 @@ var LoadtestCmd = &cobra.Command{
func init() {
ltp := new(loadTestParams)

urlInput := LoadtestCmd.PersistentFlags().StringP("url", "u", "http://localhost:8545", "The url of the JSON-RPC")
if urlInput == nil {
rpcEndpoint := LoadtestCmd.PersistentFlags().StringP("rpc-endpoint", "r", "http://localhost:8545", "The RPC endpoint")
if rpcEndpoint == nil {
panic("URL is empty")
}
var err error
ltp.URL, err = validateUrl(*urlInput)
ltp.RPCEndpoint, err = validateUrl(*rpcEndpoint)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/loadtest/loadtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func runLoadTest(ctx context.Context) error {
overallTimer = new(time.Timer)
}

rpc, err := ethrpc.DialContext(ctx, inputLoadTestParams.URL.String())
rpc, err := ethrpc.DialContext(ctx, inputLoadTestParams.RPCEndpoint.String())
if err != nil {
log.Error().Err(err).Msg("Unable to dial rpc")
return err
Expand Down

0 comments on commit 520bcf8

Please sign in to comment.