Skip to content

Commit 21a407e

Browse files
committed
fix: test
1 parent f733e75 commit 21a407e

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

go/ops_test.go

+18-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,24 @@ func TestDoHash(t *testing.T) {
6464
}
6565
}
6666

67-
func TestForgeNonexistenceProofWithIncorrectMaxPrefixLength(t *testing.T) {
68-
spec := TendermintSpec
67+
func TestForgeNonExistenceProofWithIncorrectMaxPrefixLength(t *testing.T) {
68+
spec := &ProofSpec{ // TendermintSpec
69+
LeafSpec: &LeafOp{
70+
Prefix: []byte{0},
71+
PrehashKey: HashOp_NO_HASH,
72+
Hash: HashOp_SHA256,
73+
PrehashValue: HashOp_SHA256,
74+
Length: LengthOp_VAR_PROTO,
75+
},
76+
InnerSpec: &InnerSpec{
77+
ChildOrder: []int32{0, 1},
78+
MinPrefixLength: 1,
79+
MaxPrefixLength: 1,
80+
ChildSize: 32, // (no length byte)
81+
Hash: HashOp_SHA256,
82+
},
83+
}
84+
6985
spec.InnerSpec.MaxPrefixLength = 33
7086
leafOp := spec.LeafSpec
7187
aLeaf, _ := leafOp.Apply([]byte("a"), []byte("a"))

0 commit comments

Comments
 (0)