diff options
author | Rasmus Dahlberg <rasmus@rgdd.se> | 2023-03-18 20:53:00 +0100 |
---|---|---|
committer | Rasmus Dahlberg <rasmus@rgdd.se> | 2023-03-18 20:53:00 +0100 |
commit | 5a4d99795ed1fb94035590b811a0b7d6e083a1ff (patch) | |
tree | 63303f9a586536c467dca6c20249b4e0e03c02bc | |
parent | 8ab29378ee938c7404f6ecbc6cb5a4b339bf58d7 (diff) |
Light refactoring
-rw-r--r-- | utils_state.go | 10 |
1 files 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 } |