Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
corverroos committed May 11, 2023
1 parent b279606 commit fafabf0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion cluster/state/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func hashRoot(hasher rootHasher) ([32]byte, error) {
defer ssz.DefaultHasherPool.Put(hw)

if err := hasher.HashTreeRootWith(hw); err != nil {
return [32]byte{}, err
return [32]byte{}, errors.Wrap(err, "hash tree root")
}

resp, err := hw.HashRoot()
Expand Down
8 changes: 0 additions & 8 deletions cluster/state/mutation.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,13 @@

package state

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

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

func (t MutationType) String() string {
return string(t)
}

func (t MutationType) DataType() any {
return mutationDefs[t].DataType
}

func (t MutationType) Transform(cluster Cluster, signed SignedMutation) (Cluster, error) {
// TODO(corver): Verify signature

Expand All @@ -29,11 +23,9 @@ const (
)

var mutationDefs = map[MutationType]struct {
DataType any
TransformFunc func(Cluster, SignedMutation) (Cluster, error)
}{
TypeLegacyLock: {
DataType: cluster.Lock{},
TransformFunc: transformLegacyLock,
},
}

0 comments on commit fafabf0

Please sign in to comment.