diff --git a/cmd/keycmd/derive.go b/cmd/keycmd/derive.go index 6d7021f74..e6e955da6 100644 --- a/cmd/keycmd/derive.go +++ b/cmd/keycmd/derive.go @@ -103,7 +103,7 @@ func runDerive(_ *cobra.Command, _ []string) error { switch deriveNetwork { case "mainnet": networkID = constants.MainnetID - case "testnet", "fuji": + case "testnet": networkID = constants.TestnetID case "devnet": networkID = constants.DevnetID diff --git a/internal/mocks/prompter.go b/internal/mocks/prompter.go index d7f275fee..991381469 100644 --- a/internal/mocks/prompter.go +++ b/internal/mocks/prompter.go @@ -216,7 +216,7 @@ func (m *Prompter) CaptureUint32(promptStr string) (uint32, error) { return args.Get(0).(uint32), args.Error(1) } -func (m *Prompter) CaptureFujiDuration(promptStr string) (time.Duration, error) { +func (m *Prompter) CaptureTestnetDuration(promptStr string) (time.Duration, error) { args := m.Called(promptStr) return args.Get(0).(time.Duration), args.Error(1) } diff --git a/pkg/prompts/mocks/prompter.go b/pkg/prompts/mocks/prompter.go index 3a232104c..ba027ae60 100644 --- a/pkg/prompts/mocks/prompter.go +++ b/pkg/prompts/mocks/prompter.go @@ -220,7 +220,7 @@ func (m *Prompter) CaptureUint32(promptStr string) (uint32, error) { return args.Get(0).(uint32), args.Error(1) } -func (m *Prompter) CaptureFujiDuration(promptStr string) (time.Duration, error) { +func (m *Prompter) CaptureTestnetDuration(promptStr string) (time.Duration, error) { args := m.Called(promptStr) return args.Get(0).(time.Duration), args.Error(1) } diff --git a/pkg/prompts/noninteractive.go b/pkg/prompts/noninteractive.go index 377641126..4732e818a 100644 --- a/pkg/prompts/noninteractive.go +++ b/pkg/prompts/noninteractive.go @@ -185,7 +185,7 @@ func (p *NonInteractivePrompter) CaptureUint8(promptStr string) (uint8, error) { return 0, p.fail(promptStr) } -func (p *NonInteractivePrompter) CaptureFujiDuration(promptStr string) (time.Duration, error) { +func (p *NonInteractivePrompter) CaptureTestnetDuration(promptStr string) (time.Duration, error) { return 0, p.fail(promptStr) } diff --git a/pkg/prompts/noninteractive_test.go b/pkg/prompts/noninteractive_test.go index 99df57017..f40f10891 100644 --- a/pkg/prompts/noninteractive_test.go +++ b/pkg/prompts/noninteractive_test.go @@ -89,7 +89,7 @@ func TestNonInteractivePrompter_AllMethods(t *testing.T) { {"CaptureRepoFile", func() error { _, err := p.CaptureRepoFile("", "", ""); return err }}, {"CaptureInt", func() error { _, err := p.CaptureInt("", nil); return err }}, {"CaptureUint8", func() error { _, err := p.CaptureUint8(""); return err }}, - {"CaptureFujiDuration", func() error { _, err := p.CaptureFujiDuration(""); return err }}, + {"CaptureTestnetDuration", func() error { _, err := p.CaptureTestnetDuration(""); return err }}, {"CaptureMainnetDuration", func() error { _, err := p.CaptureMainnetDuration(""); return err }}, {"CaptureMainnetL1StakingDuration", func() error { _, err := p.CaptureMainnetL1StakingDuration(""); return err }}, } diff --git a/pkg/prompts/prompter_test.go b/pkg/prompts/prompter_test.go index 76c360d73..14741a4be 100644 --- a/pkg/prompts/prompter_test.go +++ b/pkg/prompts/prompter_test.go @@ -426,7 +426,7 @@ func TestCaptureDurationEdgeCases(t *testing.T) { }) } -func TestCaptureFujiDurationWithMonkeyPatch(t *testing.T) { +func TestCaptureTestnetDurationWithMonkeyPatch(t *testing.T) { // Save original function originalRunner := promptUIRunner defer func() { @@ -564,7 +564,7 @@ func TestCaptureFujiDurationWithMonkeyPatch(t *testing.T) { } prompter := &realPrompter{} - duration, err := prompter.CaptureFujiDuration("Enter Testnet staking duration:") + duration, err := prompter.CaptureTestnetDuration("Enter Testnet staking duration:") if tt.expectError { require.Error(t, err) @@ -580,7 +580,7 @@ func TestCaptureFujiDurationWithMonkeyPatch(t *testing.T) { } } -func TestCaptureFujiDurationEdgeCases(t *testing.T) { +func TestCaptureTestnetDurationEdgeCases(t *testing.T) { // Save original function originalRunner := promptUIRunner defer func() { @@ -598,7 +598,7 @@ func TestCaptureFujiDurationEdgeCases(t *testing.T) { } prompter := &realPrompter{} - duration, err := prompter.CaptureFujiDuration("Test Testnet prompt") + duration, err := prompter.CaptureTestnetDuration("Test Testnet prompt") require.NoError(t, err) require.Equal(t, 720*time.Hour, duration) @@ -613,7 +613,7 @@ func TestCaptureFujiDurationEdgeCases(t *testing.T) { } prompter := &realPrompter{} - duration, err := prompter.CaptureFujiDuration(expectedLabel) + duration, err := prompter.CaptureTestnetDuration(expectedLabel) require.NoError(t, err) require.Equal(t, 720*time.Hour, duration) @@ -634,7 +634,7 @@ func TestCaptureFujiDurationEdgeCases(t *testing.T) { } prompter := &realPrompter{} - duration, err := prompter.CaptureFujiDuration("Enter Testnet duration:") + duration, err := prompter.CaptureTestnetDuration("Enter Testnet duration:") require.NoError(t, err) require.Equal(t, 720*time.Hour, duration) diff --git a/pkg/prompts/prompts.go b/pkg/prompts/prompts.go index ff2f7cb9b..ce30f798c 100644 --- a/pkg/prompts/prompts.go +++ b/pkg/prompts/prompts.go @@ -129,7 +129,7 @@ type Prompter interface { CaptureRepoFile(promptStr string, repo string, branch string) (string, error) CaptureInt(promptStr string, validator func(int) error) (int, error) CaptureUint8(promptStr string) (uint8, error) - CaptureFujiDuration(promptStr string) (time.Duration, error) + CaptureTestnetDuration(promptStr string) (time.Duration, error) CaptureMainnetDuration(promptStr string) (time.Duration, error) CaptureMainnetL1StakingDuration(promptStr string) (time.Duration, error) } @@ -1198,8 +1198,8 @@ func (*realPrompter) CaptureUint8(promptStr string) (uint8, error) { return uint8(val), nil //nolint:gosec // G115: Value validated to be within uint8 range } -// CaptureFujiDuration prompts for a staking duration on Testnet testnet -func (*realPrompter) CaptureFujiDuration(promptStr string) (time.Duration, error) { +// CaptureTestnetDuration prompts for a staking duration on testnet +func (*realPrompter) CaptureTestnetDuration(promptStr string) (time.Duration, error) { prompt := promptui.Prompt{ Label: promptStr, Validate: validateTestnetStakingDuration,