diff options
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/types/endpoint.go | 2 | ||||
-rw-r--r-- | pkg/types/tree_head.go | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/pkg/types/endpoint.go b/pkg/types/endpoint.go index 60bb44f..5520d16 100644 --- a/pkg/types/endpoint.go +++ b/pkg/types/endpoint.go @@ -12,6 +12,8 @@ const ( EndpointGetInclusionProof = Endpoint("get-inclusion-proof/") EndpointGetConsistencyProof = Endpoint("get-consistency-proof/") EndpointGetLeaves = Endpoint("get-leaves/") + + EndpointGetTreeHeadUnsigned = Endpoint("get-tree-head-unsigned") ) // Path joins a number of components to form a full endpoint path. For example, diff --git a/pkg/types/tree_head.go b/pkg/types/tree_head.go index baedf08..3b344cc 100644 --- a/pkg/types/tree_head.go +++ b/pkg/types/tree_head.go @@ -64,6 +64,14 @@ func (th *TreeHead) Sign(s crypto.Signer, kh *merkle.Hash) (*SignedTreeHead, err return sth, nil } +func (th *TreeHead) ToASCII(w io.Writer) error { + return ascii.StdEncoding.Serialize(w, th) +} + +func (th *TreeHead) FromASCII(r io.Reader) error { + return ascii.StdEncoding.Deserialize(r, th) +} + func (sth *SignedTreeHead) ToASCII(w io.Writer) error { return ascii.StdEncoding.Serialize(w, sth) } |