Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-axner committed Sep 25, 2024
1 parent f733e75 commit 21a407e
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions go/ops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,24 @@ func TestDoHash(t *testing.T) {
}
}

func TestForgeNonexistenceProofWithIncorrectMaxPrefixLength(t *testing.T) {
spec := TendermintSpec
func TestForgeNonExistenceProofWithIncorrectMaxPrefixLength(t *testing.T) {
spec := &ProofSpec{ // TendermintSpec
LeafSpec: &LeafOp{
Prefix: []byte{0},
PrehashKey: HashOp_NO_HASH,
Hash: HashOp_SHA256,
PrehashValue: HashOp_SHA256,
Length: LengthOp_VAR_PROTO,
},
InnerSpec: &InnerSpec{
ChildOrder: []int32{0, 1},
MinPrefixLength: 1,
MaxPrefixLength: 1,
ChildSize: 32, // (no length byte)
Hash: HashOp_SHA256,
},
}

spec.InnerSpec.MaxPrefixLength = 33
leafOp := spec.LeafSpec
aLeaf, _ := leafOp.Apply([]byte("a"), []byte("a"))
Expand Down

0 comments on commit 21a407e

Please sign in to comment.