diff options
author | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2021-02-17 19:58:27 +0100 |
---|---|---|
committer | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2021-02-17 19:58:27 +0100 |
commit | 238518951868db81cd3a004e5c3f0b99f8e82b06 (patch) | |
tree | 1df8e71e869272bc5324e7412eab9236276f3548 /type_test.go | |
parent | 72c8492ee1bd07d5960c9920e51b7addac11b806 (diff) |
added basic server-side cosigning (work in progress)
Diffstat (limited to 'type_test.go')
-rw-r--r-- | type_test.go | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/type_test.go b/type_test.go index 2e0f4b6..6ac3b29 100644 --- a/type_test.go +++ b/type_test.go @@ -222,7 +222,7 @@ func TestEncDecStItem(t *testing.T) { description: "too large checksum", item: NewChecksumV1(testPackage, make([]byte, checksumMax+1), mustNewNamespaceEd25519V1(t, testdata.Ed25519Vk)), wantErr: true, - }, // namespace (un)marshal is already tested in its own package (skip) + }, { description: "ok checksum: min", item: NewChecksumV1(testPackage, make([]byte, checksumMin), mustNewNamespaceEd25519V1(t, testdata.Ed25519Vk)), @@ -230,7 +230,19 @@ func TestEncDecStItem(t *testing.T) { { description: "ok checksum: max", item: NewChecksumV1(testPackage, make([]byte, checksumMax), mustNewNamespaceEd25519V1(t, testdata.Ed25519Vk)), - }, + }, // namespace (un)marshal is already tested in its own package (skip) + { + description: "ok cosigned sth", + item: NewCosignedTreeHeadV1( + NewSignedTreeHeadV1(NewTreeHeadV1(makeTrillianLogRoot(t, testTimestamp, testTreeSize, testNodeHash)), testLogId, testSignature).SignedTreeHeadV1, + []SignatureV1{ + SignatureV1{ + *mustNewNamespaceEd25519V1(t, testdata.Ed25519Vk), + testSignature, + }, + }, + ), + }, // TODO: the only thing that is not tested elsewhere for cosigned sth is bound on signature. Unify signature into a type => some tests go away. } { b, err := table.item.MarshalB64() if err != nil && !table.wantErr { |