Skip to content

Commit c078331

Browse files
committed
make gen
1 parent 3d68dec commit c078331

File tree

5 files changed

+29
-31
lines changed

5 files changed

+29
-31
lines changed

cmd/flag_loader/flag_loader.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package flag_loader
22

33
import (
44
"fmt"
5-
"os"
65
"math/big"
6+
"os"
77

88
"github.com/spf13/cobra"
99
)
@@ -14,24 +14,24 @@ const (
1414
)
1515

1616
type BigIntValue struct {
17-
Val *big.Int
17+
Val *big.Int
1818
}
1919

2020
func (b *BigIntValue) String() string {
21-
// Return the decimal representation
22-
return b.Val.String()
21+
// Return the decimal representation
22+
return b.Val.String()
2323
}
2424

2525
func (b *BigIntValue) Set(s string) error {
26-
// Parse the string in base 10
27-
if _, ok := b.Val.SetString(s, 10); !ok {
28-
return fmt.Errorf("invalid big integer: %q", s)
29-
}
30-
return nil
26+
// Parse the string in base 10
27+
if _, ok := b.Val.SetString(s, 10); !ok {
28+
return fmt.Errorf("invalid big integer: %q", s)
29+
}
30+
return nil
3131
}
3232

3333
func (b *BigIntValue) Type() string {
34-
return "big.Int"
34+
return "big.Int"
3535
}
3636

3737
func GetRpcUrlFlagValue(cmd *cobra.Command) *string {

cmd/fund/cmd.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ type cmdFundParams struct {
3636

3737
var (
3838
//go:embed usage.md
39-
usage string
40-
params cmdFundParams
39+
usage string
40+
params cmdFundParams
4141
defaultFundingInWei = big.NewInt(50000000000000000) // 0.05 ETH
4242
)
4343

@@ -70,7 +70,7 @@ func init() {
7070
p.UseHDDerivation = flagSet.Bool("hd-derivation", true, "Derive wallets to fund from the private key in a deterministic way")
7171
p.WalletAddresses = flagSet.StringSlice("addresses", nil, "Comma-separated list of wallet addresses to fund")
7272
p.FundingAmountInWei = defaultFundingInWei
73-
flagSet.Var(&flag_loader.BigIntValue{Val: p.FundingAmountInWei }, "eth-amount", "The amount of wei to send to each wallet")
73+
flagSet.Var(&flag_loader.BigIntValue{Val: p.FundingAmountInWei}, "eth-amount", "The amount of wei to send to each wallet")
7474

7575
p.OutputFile = flagSet.StringP("file", "f", "wallets.json", "The output JSON file path for storing the addresses and private keys of funded wallets")
7676

cmd/monitorv2/renderer/tview_renderer.go

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ type TviewRenderer struct {
139139
searchForm *tview.Form
140140

141141
// Modal state management
142-
isModalActive bool
143-
activeModalName string
144-
previousPageName string // Track page before modal was opened
145-
modalStateMu sync.RWMutex
142+
isModalActive bool
143+
activeModalName string
144+
previousPageName string // Track page before modal was opened
145+
modalStateMu sync.RWMutex
146146
}
147147

148148
// NewTviewRenderer creates a new TUI renderer using tview
@@ -778,7 +778,6 @@ func formatConnectionStatus(latency time.Duration) string {
778778
}
779779
}
780780

781-
782781
// formatRelativeTime converts Unix timestamp to human-readable relative time
783782
func formatRelativeTime(timestamp uint64) string {
784783
now := time.Now().Unix()
@@ -870,12 +869,12 @@ func formatBaseFee(baseFee *big.Int) string {
870869
}
871870

872871
units := []unit{
873-
{new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil), "ether", new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil), 3}, // 10^18
874-
{new(big.Int).Exp(big.NewInt(10), big.NewInt(15), nil), "milli", new(big.Int).Exp(big.NewInt(10), big.NewInt(15), nil), 3}, // 10^15 milliether
875-
{new(big.Int).Exp(big.NewInt(10), big.NewInt(12), nil), "micro", new(big.Int).Exp(big.NewInt(10), big.NewInt(12), nil), 3}, // 10^12 microether
876-
{new(big.Int).Exp(big.NewInt(10), big.NewInt(9), nil), "gwei", new(big.Int).Exp(big.NewInt(10), big.NewInt(9), nil), 3}, // 10^9 gwei
877-
{new(big.Int).Exp(big.NewInt(10), big.NewInt(6), nil), "mwei", new(big.Int).Exp(big.NewInt(10), big.NewInt(6), nil), 3}, // 10^6 megawei
878-
{new(big.Int).Exp(big.NewInt(10), big.NewInt(3), nil), "kwei", new(big.Int).Exp(big.NewInt(10), big.NewInt(3), nil), 3}, // 10^3 kilowei
872+
{new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil), "ether", new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil), 3}, // 10^18
873+
{new(big.Int).Exp(big.NewInt(10), big.NewInt(15), nil), "milli", new(big.Int).Exp(big.NewInt(10), big.NewInt(15), nil), 3}, // 10^15 milliether
874+
{new(big.Int).Exp(big.NewInt(10), big.NewInt(12), nil), "micro", new(big.Int).Exp(big.NewInt(10), big.NewInt(12), nil), 3}, // 10^12 microether
875+
{new(big.Int).Exp(big.NewInt(10), big.NewInt(9), nil), "gwei", new(big.Int).Exp(big.NewInt(10), big.NewInt(9), nil), 3}, // 10^9 gwei
876+
{new(big.Int).Exp(big.NewInt(10), big.NewInt(6), nil), "mwei", new(big.Int).Exp(big.NewInt(10), big.NewInt(6), nil), 3}, // 10^6 megawei
877+
{new(big.Int).Exp(big.NewInt(10), big.NewInt(3), nil), "kwei", new(big.Int).Exp(big.NewInt(10), big.NewInt(3), nil), 3}, // 10^3 kilowei
879878
{big.NewInt(1), "wei", big.NewInt(1), 0}, // wei (no decimals)
880879
}
881880

@@ -899,7 +898,7 @@ func formatBaseFee(baseFee *big.Int) string {
899898
// Format with appropriate precision
900899
formatStr := fmt.Sprintf("%%.%df %%s", u.decimals)
901900
resultFloat, _ := result.Float64()
902-
901+
903902
// Remove trailing zeros from decimal representation
904903
formatted := fmt.Sprintf(formatStr, resultFloat, u.name)
905904
return removeTrailingZeros(formatted)
@@ -1393,7 +1392,7 @@ func (t *TviewRenderer) showSearchError(message string) {
13931392
func (t *TviewRenderer) showModal(name string) {
13941393
// Get current page before showing modal
13951394
currentPage, _ := t.pages.GetFrontPage()
1396-
1395+
13971396
t.modalStateMu.Lock()
13981397
t.isModalActive = true
13991398
t.activeModalName = name

doc/polycli_loadtest.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ The codebase has a contract that used for load testing. It's written in Solidity
158158
--seed int A seed for generating random values and addresses (default 123456)
159159
--sending-address-count uint The number of sending addresses to use. This is useful for avoiding pool account queue. (default 1)
160160
--sending-addresses-file string The file containing the sending addresses private keys, one per line. This is useful for avoiding pool account queue but also to keep the same sending addresses for different execution cycles.
161-
--skip-contract-deploy Some load test modes don't require a contract deployment. Set this flag to true(default) to skip contract deployments. This will still respect the --loadtest-contract-address flags. (default true)
162161
--store-data-size uint If we're in store mode, this controls how many bytes we'll try to store in our contract (default 1024)
163162
--summarize Should we produce an execution summary after the load test has finished. If you're running a large load test, this can take a long time
164163
-t, --time-limit int Maximum number of seconds to spend for benchmarking. Use this to benchmark within a fixed total amount of time. Per default there is no time limit. (default -1)

rpctypes/pretty.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,21 @@ func (h *HexBytes) UnmarshalJSON(data []byte) error {
4848
if err := json.Unmarshal(data, &s); err != nil {
4949
return err
5050
}
51-
51+
5252
if s == "" || s == "0x" {
5353
*h = HexBytes{}
5454
return nil
5555
}
56-
56+
5757
if !strings.HasPrefix(s, "0x") {
5858
return fmt.Errorf("hex string must start with 0x")
5959
}
60-
60+
6161
decoded, err := hex.DecodeString(s[2:])
6262
if err != nil {
6363
return err
6464
}
65-
65+
6666
*h = HexBytes(decoded)
6767
return nil
6868
}

0 commit comments

Comments
 (0)