wathtower/blob+wtserver: support anchor sessions

This commit is contained in:
Conner Fromknecht
2020-11-25 15:04:00 -08:00
parent 069296c46c
commit 3856acce50
4 changed files with 35 additions and 3 deletions

View File

@@ -138,8 +138,9 @@ func (t Type) String() string {
// supportedTypes is the set of all configurations known to be supported by the
// package.
var supportedTypes = map[Type]struct{}{
TypeAltruistCommit: {},
TypeRewardCommit: {},
TypeAltruistCommit: {},
TypeRewardCommit: {},
TypeAltruistAnchorCommit: {},
}
// IsSupportedType returns true if the given type is supported by the package.

View File

@@ -123,6 +123,12 @@ func TestSupportedTypes(t *testing.T) {
t.Fatalf("default type %s is not supported", blob.TypeAltruistCommit)
}
// Assert that the altruist anchor commit types are supported.
if !blob.IsSupportedType(blob.TypeAltruistAnchorCommit) {
t.Fatalf("default type %s is not supported",
blob.TypeAltruistAnchorCommit)
}
// Assert that all claimed supported types are actually supported.
for _, supType := range blob.SupportedTypes() {
if blob.IsSupportedType(supType) {