From 26b786d9857db21fdf110eaf9cb6d1d6e4e68ef9 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Mon, 13 Sep 2021 19:53:17 +0200 Subject: updated (co)signed tree head structures - Added key_hash in tree head, see motivation in api.md - Added separate types for (co)signed tree heads - Refactored tree head HTTP APIs to be current, see api.md --- pkg/types/trunnel_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg/types/trunnel_test.go') diff --git a/pkg/types/trunnel_test.go b/pkg/types/trunnel_test.go index 297578c..a3ae1ba 100644 --- a/pkg/types/trunnel_test.go +++ b/pkg/types/trunnel_test.go @@ -48,16 +48,18 @@ func TestMarshalLeaf(t *testing.T) { } func TestMarshalTreeHead(t *testing.T) { - description := "valid: timestamp 16909060, tree size 72623859790382856, root hash 0x00,0x01,..." + description := "valid: timestamp 16909060, tree size 72623859790382856, root hash & key hash 0x00,0x01,..." th := &TreeHead{ Timestamp: 16909060, TreeSize: 72623859790382856, RootHash: testBuffer32, + KeyHash: testBuffer32, } want := bytes.Join([][]byte{ []byte{0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04}, []byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}, testBuffer32[:], + testBuffer32[:], }, nil) if got := th.Marshal(); !bytes.Equal(got, want) { t.Errorf("got tree head\n\t%v\nbut wanted\n\t%v\nin test %q\n", got, want, description) -- cgit v1.2.3