Skip to content

Commit 8a2de58

Browse files
committed
fix: lint
1 parent 7b73024 commit 8a2de58

File tree

5 files changed

+16
-25
lines changed

5 files changed

+16
-25
lines changed

cmd/loadtest/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,6 @@ func initUniswapv3Flags() {
181181
f.StringVar(&uniswapCfg.PoolToken1, "uniswap-pool-token-1-address", "", "address of pre-deployed ERC20 contract used in Uniswap pool Token0 // Token1")
182182

183183
// Pool and swap parameters.
184-
f.Float64VarP(&uniswapCfg.PoolFees, "pool-fees", "f", float64(uniswapv3.StandardTier), "trading fees for UniswapV3 liquidity pool swaps (e.g. 0.3 means 0.3%%)")
184+
f.Float64VarP(&uniswapCfg.PoolFees, "pool-fees", "f", float64(uniswapv3.StandardTier), "trading fees for UniswapV3 liquidity pool swaps (e.g. 0.3 means 0.3%)")
185185
f.Uint64VarP(&uniswapCfg.SwapAmountInput, "swap-amount", "a", uniswapv3.SwapAmountInput.Uint64(), "amount of inbound token given as swap input")
186186
}

doc/polycli_loadtest.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ The codebase has a contract that used for load testing. It's written in Solidity
8787
--adaptive-target-size uint target queue size for adaptive rate limiting (speed up if smaller, back off if larger) (default 1000)
8888
--batch-size uint batch size for receipt fetching (default: 999) (default 999)
8989
--blob-fee-cap uint blob fee cap, or maximum blob fee per chunk, in Gwei (default 100000)
90+
--block-batch-size uint number of blocks to fetch per RPC batch request for recall and rpc modes (default 25)
9091
--calldata string hex encoded calldata: function signature + encoded arguments (requires --mode contract-call and --contract-address)
9192
--chain-id uint chain ID for the transactions
9293
--check-balance-before-funding check account balance before funding sending accounts (saves gas when accounts are already funded)
@@ -164,5 +165,5 @@ The command also inherits flags from parent commands.
164165
## See also
165166
166167
- [polycli](polycli.md) - A Swiss Army knife of blockchain tools.
167-
- [polycli loadtest uniswapv3](polycli_loadtest_uniswapv3.md) - Run Uniswapv3-like load test against an Eth/EVm style JSON-RPC endpoint.
168+
- [polycli loadtest uniswapv3](polycli_loadtest_uniswapv3.md) - Run UniswapV3-like load test against an Eth/EVM style JSON-RPC endpoint.
168169

doc/polycli_loadtest_uniswapv3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
## Description
1313

14-
Run Uniswapv3-like load test against an Eth/EVm style JSON-RPC endpoint.
14+
Run UniswapV3-like load test against an Eth/EVM style JSON-RPC endpoint.
1515

1616
```bash
1717
polycli loadtest uniswapv3 [flags]

loadtest/config/mode_string.go

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

loadtest/modes/deploy.go

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/0xPolygon/polygon-cli/loadtest/mode"
1010
"github.com/ethereum/go-ethereum/accounts/abi/bind"
1111
"github.com/ethereum/go-ethereum/common"
12+
"github.com/ethereum/go-ethereum/core/types"
1213
)
1314

1415
func init() {
@@ -45,39 +46,29 @@ func (m *DeployMode) Init(ctx context.Context, cfg *config.Config, deps *mode.De
4546
func (m *DeployMode) Execute(ctx context.Context, cfg *config.Config, deps *mode.Dependencies, tops *bind.TransactOpts) (start, end time.Time, txHash common.Hash, err error) {
4647
start = time.Now()
4748
defer func() { end = time.Now() }()
49+
var tx *types.Transaction
4850

4951
if cfg.EthCallOnly {
5052
msg := mode.TransactOptsToCallMsg(cfg, tops.GasLimit)
5153
msg.Data = common.FromHex(tester.LoadTesterMetaData.Bin)
5254
_, err = deps.Client.CallContract(ctx, msg, nil)
5355
} else if cfg.OutputRawTxOnly {
5456
tops.NoSend = true
55-
var tx any
5657
_, tx, _, err = tester.DeployLoadTester(tops, deps.Client)
5758
if err != nil {
5859
return
5960
}
60-
if tx != nil {
61-
// Type assert to get hash and output
62-
if typedTx, ok := tx.(interface{ Hash() common.Hash }); ok {
63-
txHash = typedTx.Hash()
64-
}
65-
if typedTx, ok := tx.(interface{ MarshalBinary() ([]byte, error) }); ok {
66-
rawTx, marshalErr := typedTx.MarshalBinary()
67-
if marshalErr != nil {
68-
err = marshalErr
69-
return
70-
}
71-
err = mode.OutputRawBytes(rawTx)
72-
}
61+
txHash = tx.Hash()
62+
rawTx, marshalErr := tx.MarshalBinary()
63+
if marshalErr != nil {
64+
err = marshalErr
65+
return
7366
}
67+
err = mode.OutputRawBytes(rawTx)
7468
} else {
75-
var tx any
7669
_, tx, _, err = tester.DeployLoadTester(tops, deps.Client)
77-
if err == nil && tx != nil {
78-
if typedTx, ok := tx.(interface{ Hash() common.Hash }); ok {
79-
txHash = typedTx.Hash()
80-
}
70+
if err == nil {
71+
txHash = tx.Hash()
8172
}
8273
}
8374
return

0 commit comments

Comments
 (0)