aboutsummaryrefslogtreecommitdiff
path: root/pkg/types/trunnel_test.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2021-09-13 19:53:17 +0200
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2021-09-13 19:53:17 +0200
commit26b786d9857db21fdf110eaf9cb6d1d6e4e68ef9 (patch)
tree92606f47a91ebcc9e3cb4258af7a9472fc6f2e07 /pkg/types/trunnel_test.go
parentf34351da0731a11316e2266d2aadd62554a5b867 (diff)
updated (co)signed tree head structuresv0.2.0
- 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
Diffstat (limited to 'pkg/types/trunnel_test.go')
-rw-r--r--pkg/types/trunnel_test.go4
1 files changed, 3 insertions, 1 deletions
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)