@@ -49,7 +49,7 @@ func (c Checkpoint) String() string {
4949}
5050
5151// MarshalText returns the common format representation of this Checkpoint.
52- func (c Checkpoint ) MarshalText () ([]byte , error ) {
52+ func (c Checkpoint ) MarshalCheckpoint () ([]byte , error ) {
5353 return []byte (c .String ()), nil
5454}
5555
@@ -65,7 +65,7 @@ func (c Checkpoint) MarshalText() ([]byte, error) {
6565// <optional non-empty line of other content>...
6666//
6767// This will discard any content found after the checkpoint (including signatures)
68- func (c * Checkpoint ) UnmarshalText (data []byte ) error {
68+ func (c * Checkpoint ) UnmarshalCheckpoint (data []byte ) error {
6969 l := bytes .Split (data , []byte ("\n " ))
7070 if len (l ) < 4 {
7171 return errors .New ("invalid checkpoint - too few newlines" )
@@ -104,7 +104,7 @@ type SignedCheckpoint struct {
104104}
105105
106106func CreateSignedCheckpoint (c Checkpoint ) (* SignedCheckpoint , error ) {
107- text , err := c .MarshalText ()
107+ text , err := c .MarshalCheckpoint ()
108108 if err != nil {
109109 return nil , err
110110 }
@@ -120,12 +120,12 @@ func SignedCheckpointValidator(strToValidate string) bool {
120120 return false
121121 }
122122 c := & Checkpoint {}
123- return c .UnmarshalText ([]byte (s .Note )) == nil
123+ return c .UnmarshalCheckpoint ([]byte (s .Note )) == nil
124124}
125125
126126func CheckpointValidator (strToValidate string ) bool {
127127 c := & Checkpoint {}
128- return c .UnmarshalText ([]byte (strToValidate )) == nil
128+ return c .UnmarshalCheckpoint ([]byte (strToValidate )) == nil
129129}
130130
131131func (r * SignedCheckpoint ) UnmarshalText (data []byte ) error {
@@ -134,7 +134,7 @@ func (r *SignedCheckpoint) UnmarshalText(data []byte) error {
134134 return errors .Wrap (err , "unmarshalling signed note" )
135135 }
136136 c := Checkpoint {}
137- if err := c .UnmarshalText ([]byte (s .Note )); err != nil {
137+ if err := c .UnmarshalCheckpoint ([]byte (s .Note )); err != nil {
138138 return errors .Wrap (err , "unmarshalling checkpoint" )
139139 }
140140 * r = SignedCheckpoint {Checkpoint : c , SignedNote : s }
0 commit comments