Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/keycmd/derive.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/mocks/prompter.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/prompts/mocks/prompter.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/prompts/noninteractive.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/prompts/noninteractive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 }},
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/prompts/prompter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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)
Expand All @@ -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() {
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions pkg/prompts/prompts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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,
Expand Down
Loading