Harden Go SDK head store persistence
This commit is contained in:
+3
-2
@@ -476,8 +476,9 @@ func (a *app) doctor(ctx context.Context, args []string) error {
|
||||
}
|
||||
|
||||
headStore := attesto.NewFileHeadStore("")
|
||||
headStore.Set("__doctor__", 1, strings.Repeat("0", 64))
|
||||
if seq, hash, ok := headStore.Get("__doctor__"); ok && seq == 1 && hash == strings.Repeat("0", 64) {
|
||||
if err := headStore.SetWithError("__doctor__", 1, strings.Repeat("0", 64)); err != nil {
|
||||
fail("head_store", err)
|
||||
} else if seq, hash, ok := headStore.Get("__doctor__"); ok && seq == 1 && hash == strings.Repeat("0", 64) {
|
||||
pass("head_store", nil)
|
||||
} else {
|
||||
fail("head_store", errors.New("head store readback failed"))
|
||||
|
||||
Reference in New Issue
Block a user