| 86 | } |
| 87 | |
| 88 | func (op *EditCommentOperation) Validate() error { |
| 89 | if err := op.OpBase.Validate(op, EditCommentOp); err != nil { |
| 90 | return err |
| 91 | } |
| 92 | |
| 93 | if err := op.Target.Validate(); err != nil { |
| 94 | return errors.Wrap(err, "target hash is invalid") |
| 95 | } |
| 96 | |
| 97 | if !text.Safe(op.Message) { |
| 98 | return fmt.Errorf("message is not fully printable") |
| 99 | } |
| 100 | |
| 101 | return nil |
| 102 | } |
| 103 | |
| 104 | func NewEditCommentOp(author identity.Interface, unixTime int64, target entity.Id, message string, files []repository.Hash) *EditCommentOperation { |
| 105 | return &EditCommentOperation{ |