From 5a4d99795ed1fb94035590b811a0b7d6e083a1ff Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Sat, 18 Mar 2023 20:53:00 +0100 Subject: Light refactoring --- utils_state.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils_state.go b/utils_state.go index 2273c24..89d2fc2 100644 --- a/utils_state.go +++ b/utils_state.go @@ -14,11 +14,11 @@ type treeHead struct { RootHash [sha256.Size]byte `json:root_hash"` } -func readState(opts options, logID []byte) (treeHead, error) { - if _, err := os.Stat(fmt.Sprintf("%s/%x/%s", opts.logDirectory, logID, opts.stateFile)); err != nil { +func readState(opts options, id []byte) (treeHead, error) { + if _, err := os.Stat(fmt.Sprintf("%s/%x/%s", opts.logDirectory, id, opts.stateFile)); err != nil { return treeHead{0, sha256.Sum256(nil)}, nil } - b, err := os.ReadFile(fmt.Sprintf("%s/%x/%s", opts.logDirectory, logID, opts.stateFile)) + b, err := os.ReadFile(fmt.Sprintf("%s/%x/%s", opts.logDirectory, id, opts.stateFile)) if err != nil { return treeHead{}, err } @@ -29,8 +29,8 @@ func readState(opts options, logID []byte) (treeHead, error) { return th, nil } -func readSnapshot(opts options, logID []byte) (ct.SignedTreeHead, error) { - b, err := os.ReadFile(fmt.Sprintf("%s/%x/%s", opts.logDirectory, logID, opts.sthFile)) +func readSnapshot(opts options, id []byte) (ct.SignedTreeHead, error) { + b, err := os.ReadFile(fmt.Sprintf("%s/%x/%s", opts.logDirectory, id, opts.sthFile)) if err != nil { return ct.SignedTreeHead{}, err } -- cgit v1.2.3