Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
corverroos committed May 10, 2023
1 parent 83037e1 commit b279606
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions cluster/state/mutation.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package state

import "github.com/obolnetwork/charon/cluster"

// MutationType represents the type of a mutation.
type MutationType string

func (t MutationType) String() string {
Expand Down
2 changes: 2 additions & 0 deletions cluster/state/mutationlegacylock.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func (l lockWrapper) HashTreeRootWith(hw ssz.HashWalker) error {
return nil
}

// verifyLegacyLock verifies that the signed mutation is a valid legacy lock.
func verifyLegacyLock(signed SignedMutation) error {
if signed.Mutation.Type != TypeLegacyLock {
return errors.New("invalid mutation type")
Expand All @@ -78,6 +79,7 @@ func verifyLegacyLock(signed SignedMutation) error {
return wrapper.Lock.VerifySignatures()
}

// transformLegacyLock transforms the cluster state with the provided legacy lock mutation.
func transformLegacyLock(_ Cluster, signed SignedMutation) (Cluster, error) {
if err := verifyLegacyLock(signed); err != nil {
return Cluster{}, errors.Wrap(err, "verify legacy lock")
Expand Down
1 change: 1 addition & 0 deletions cluster/state/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
// RawDAG is a list of mutations that constitute the raw cluster state DAG.
type RawDAG []Mutation

// rootHasher indicates that a type can be hashed with a ssz.HashWalker.
type rootHasher interface {
HashTreeRootWith(hw ssz.HashWalker) error
}
Expand Down

0 comments on commit b279606

Please sign in to comment.