Skip to content

Commit 20e9f42

Browse files
committed
refactor: remove one line fn
1 parent d8f9ef6 commit 20e9f42

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

go/ops.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (op *LeafOp) CheckAgainstSpec(spec *ProofSpec) error {
120120
return errors.New("spec.LeafSpec must be non-nil")
121121
}
122122

123-
if validateSpec(spec) {
123+
if spec.SpecEquals(IavlSpec) {
124124
err := validateIavlOps(op, 0)
125125
if err != nil {
126126
return err
@@ -161,7 +161,7 @@ func (op *InnerOp) CheckAgainstSpec(spec *ProofSpec, b int) error {
161161
return fmt.Errorf("unexpected HashOp: %d", op.Hash)
162162
}
163163

164-
if validateSpec(spec) {
164+
if spec.SpecEquals(IavlSpec) {
165165
err := validateIavlOps(op, b)
166166
if err != nil {
167167
return err
@@ -246,10 +246,6 @@ func prepareLeafData(hashOp HashOp, lengthOp LengthOp, data []byte) ([]byte, err
246246
return doLengthOp(lengthOp, hdata)
247247
}
248248

249-
func validateSpec(spec *ProofSpec) bool {
250-
return spec.SpecEquals(IavlSpec)
251-
}
252-
253249
type opType interface {
254250
GetPrefix() []byte
255251
GetHash() HashOp

0 commit comments

Comments
 (0)