Skip to content

Commit 77762fe

Browse files
committed
rename initialized to unlocked to avoid confusion
1 parent 8e89773 commit 77762fe

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
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/pairing.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func (device *Device) ChannelHashVerify(ok bool) {
175175
return
176176
}
177177
if info.Initialized {
178-
device.changeStatus(StatusInitialized)
178+
device.changeStatus(StatusUnlocked)
179179
} else {
180180
device.changeStatus(StatusUninitialized)
181181
}

api/firmware/status.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const (
2424
StatusConnected Status = "connected"
2525

2626
// StatusUnpaired means the pairing has not been confirmed yet. After the pairing screen has
27-
// been confirmed, we move to StatusUninitialized or StatusInitialized depending on the device
27+
// been confirmed, we move to StatusUninitialized or StatusUnlocked depending on the device
2828
// status.
2929
StatusUnpaired Status = "unpaired"
3030

@@ -36,12 +36,12 @@ const (
3636
StatusUninitialized Status = "uninitialized"
3737

3838
// StatusSeeded is after SetPassword(), before CreateBack() during initialization of the
39-
// device. Use CreateBackup() to move to StatusInitialized.
39+
// device. Use CreateBackup() to move to StatusUnlocked.
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).

api/firmware/system.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (device *Device) SetPassword(seedLen int) error {
8787
if seedLen == 16 && !device.version.AtLeast(semver.NewSemVer(9, 6, 0)) {
8888
return UnsupportedError("9.6.0")
8989
}
90-
if device.status == StatusInitialized {
90+
if device.status == StatusUnlocked {
9191
return errp.New("invalid status")
9292
}
9393
request := &messages.Request{

0 commit comments

Comments
 (0)