Skip to content

Commit 3c00608

Browse files
committed
rename initialized to unlocked to avoid confusion
1 parent 8e89773 commit 3c00608

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

api/firmware/backup.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
// CreateBackup is called after SetPassword() to create the backup.
2525
func (device *Device) CreateBackup() error {
26-
if device.status != StatusSeeded && device.status != StatusInitialized {
26+
if device.status != StatusSeeded && device.status != StatusUnlocked {
2727
return errp.New("invalid status")
2828
}
2929

@@ -49,7 +49,7 @@ func (device *Device) CreateBackup() error {
4949
return errp.New("unexpected response")
5050
}
5151
if device.status == StatusSeeded {
52-
device.changeStatus(StatusInitialized)
52+
device.changeStatus(StatusUnlocked)
5353
}
5454
return nil
5555
}
@@ -130,6 +130,6 @@ func (device *Device) RestoreBackup(id string) error {
130130
if !ok {
131131
return errp.New("unexpected response")
132132
}
133-
device.changeStatus(StatusInitialized)
133+
device.changeStatus(StatusUnlocked)
134134
return nil
135135
}

api/firmware/backup_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func TestSimulatorBackups(t *testing.T) {
3838
require.Error(t, err)
3939

4040
require.NoError(t, device.CreateBackup())
41-
require.Equal(t, StatusInitialized, device.Status())
41+
require.Equal(t, StatusUnlocked, device.Status())
4242

4343
list, err = device.ListBackups()
4444
require.NoError(t, err)

api/firmware/device.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ func (device *Device) Init() error {
261261
if !deviceInfo.version.AtLeast(semver.NewSemVer(9, 20, 0)) {
262262
device.changeStatus(StatusConnected)
263263
} else if deviceInfo.unlocked {
264-
device.changeStatus(StatusInitialized)
264+
device.changeStatus(StatusUnlocked)
265265
} else if *deviceInfo.initialized {
266266
// deviceInfo.initialized is not nil if version is at least 9.20.0.
267267
device.changeStatus(StatusConnected)

api/firmware/mnemonic.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (device *Device) ShowMnemonic() error {
3838
return errp.New("unexpected response")
3939
}
4040
if device.status == StatusSeeded {
41-
device.changeStatus(StatusInitialized)
41+
device.changeStatus(StatusUnlocked)
4242
}
4343
return nil
4444
}
@@ -63,7 +63,7 @@ func (device *Device) RestoreFromMnemonic() error {
6363
if !ok {
6464
return errp.New("unexpected response")
6565
}
66-
device.changeStatus(StatusInitialized)
66+
device.changeStatus(StatusUnlocked)
6767
return nil
6868
}
6969

api/firmware/status.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ const (
3939
// device. Use CreateBackup() to move to StatusInitialized.
4040
StatusSeeded Status = "seeded"
4141

42-
// StatusInitialized means the device is seeded and the backup was created, and the device is
42+
// StatusUnlocked means the device is seeded and the backup was created, and the device is
4343
// unlocked. The keystore is ready to use.
44-
StatusInitialized Status = "initialized"
44+
StatusUnlocked Status = "unlocked"
4545

4646
// StatusRequireFirmwareUpgrade means that the a firmware upgrade is required before being able
4747
// to proceed to StatusLoggedIn or StatusSeeded (firmware version too old).

0 commit comments

Comments
 (0)