aboutsummaryrefslogtreecommitdiff
path: root/trillian_test.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-17 15:34:33 +0100
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-17 15:34:33 +0100
commitc11006fb89bcac7fdfc2278990b2b1a3a3553ba9 (patch)
tree7dc1547912ba1a018b56e8e1dc4e3fe27d4cbff9 /trillian_test.go
parentf02d9ad52b4b70fc1af8224201cf993faa82eaee (diff)
added type tests
As a result these changes were made: - Simplified a few New* functions - Allowed empty inclusion and consistency proofs, which is in contrast to not being able to marshal them due to `tls:"minlen:1"`. For example, an inclusion proof will be empty for a Merkle tree of size 1. - Disallowed empty signatures and chains in a leaf's Appendix - Removed unnecessary examples
Diffstat (limited to 'trillian_test.go')
-rw-r--r--trillian_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/trillian_test.go b/trillian_test.go
index 7b26bb9..174fa13 100644
--- a/trillian_test.go
+++ b/trillian_test.go
@@ -5,6 +5,7 @@ import (
"testing"
"github.com/google/trillian"
+ "github.com/google/trillian/types"
"github.com/system-transparency/stfe/server/testdata"
"google.golang.org/grpc/codes"
@@ -112,3 +113,13 @@ func makeTrillianGetLeavesByRangeResponse(t *testing.T, start, end int64, name,
SignedLogRoot: testdata.NewGetLatestSignedLogRootResponse(t, 0, uint64(end)+1, make([]byte, 32)).SignedLogRoot,
}
}
+
+func makeTrillianLogRoot(t *testing.T, timestamp, size uint64, hash []byte) *types.LogRootV1 {
+ return &types.LogRootV1{
+ TreeSize: size,
+ RootHash: hash,
+ TimestampNanos: timestamp,
+ Revision: 0, // not used by stfe
+ Metadata: nil, // not used by stfe
+ }
+}