From 21a407ecbc5a8202c3fc464a44f8e50248b4f649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:11:25 +0200 Subject: [PATCH] fix: test --- go/ops_test.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/go/ops_test.go b/go/ops_test.go index 82763250..440a08a1 100644 --- a/go/ops_test.go +++ b/go/ops_test.go @@ -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"))