diff --git a/cli/spam.go b/cli/spam.go index 75d0a3b4f9..7391394b69 100644 --- a/cli/spam.go +++ b/cli/spam.go @@ -44,7 +44,7 @@ func (h *Handler) BuildSpammer(sh throughput.SpamHelper, defaults bool) (*throug } if defaults { - sc := throughput.DefaultSpamConfig(uris, key) + sc := throughput.NewDefaultConfig(uris, key) return throughput.NewSpammer(sc, sh) } // Collect parameters @@ -81,7 +81,7 @@ func (h *Handler) BuildSpammer(sh throughput.SpamHelper, defaults bool) (*throug return nil, err } - sc := throughput.NewSpamConfig( + sc := throughput.NewConfig( uris, key, sZipf, diff --git a/tests/e2e/e2e.go b/tests/e2e/e2e.go index df4a2382b0..994ae1aa87 100644 --- a/tests/e2e/e2e.go +++ b/tests/e2e/e2e.go @@ -130,7 +130,7 @@ var _ = ginkgo.Describe("[HyperSDK Spam Workloads]", func() { err := spamHelper.CreateClient(uris[0]) require.NoError(err) - spamConfig := throughput.DefaultSpamConfig(uris, key) + spamConfig := throughput.NewDefaultConfig(uris, key) spammer, err := throughput.NewSpammer(spamConfig, spamHelper) require.NoError(err) diff --git a/throughput/config.go b/throughput/config.go index fa32cff3c8..bff2524e1a 100644 --- a/throughput/config.go +++ b/throughput/config.go @@ -5,7 +5,7 @@ package throughput import "github.com/ava-labs/hypersdk/auth" -type SpamConfig struct { +type Config struct { uris []string key *auth.PrivateKey sZipf float64 @@ -17,11 +17,11 @@ type SpamConfig struct { numAccounts int } -func DefaultSpamConfig( +func NewDefaultConfig( uris []string, key *auth.PrivateKey, -) *SpamConfig { - return &SpamConfig{ +) *Config { + return &Config{ uris: uris, key: key, sZipf: 1.01, @@ -34,7 +34,7 @@ func DefaultSpamConfig( } } -func NewSpamConfig( +func NewConfig( uris []string, key *auth.PrivateKey, sZipf float64, @@ -44,8 +44,8 @@ func NewSpamConfig( txsPerSecondStep int, numClients int, numAccounts int, -) *SpamConfig { - return &SpamConfig{ +) *Config { + return &Config{ uris, key, sZipf, diff --git a/throughput/spam.go b/throughput/spam.go index a0b2c5b773..f9f40b91c4 100644 --- a/throughput/spam.go +++ b/throughput/spam.go @@ -71,9 +71,7 @@ type Spammer struct { numAccounts int } -func NewSpammer(sc *SpamConfig, - sh SpamHelper, -) (*Spammer, error) { +func NewSpammer(sc *Config, sh SpamHelper) (*Spammer, error) { // Log Zipf participants zipfSeed := rand.New(rand.NewSource(0)) //nolint:gosec balance, err := sh.LookupBalance(sc.key.Address)