diff options
Diffstat (limited to 'bug/operation.go')
-rw-r--r-- | bug/operation.go | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/bug/operation.go b/bug/operation.go index 2e86921a..b5c6b1de 100644 --- a/bug/operation.go +++ b/bug/operation.go @@ -135,7 +135,7 @@ func operationUnmarshaller(author identity.Interface, raw json.RawMessage, resol // OpBase implement the common code for all operations type OpBase struct { OperationType OperationType `json:"type"` - Author_ identity.Interface `json:"author"` + Author_ identity.Interface `json:"-"` // not serialized // TODO: part of the data model upgrade, this should eventually be a timestamp + lamport UnixTime int64 `json:"timestamp"` Metadata map[string]string `json:"metadata,omitempty"` @@ -178,7 +178,6 @@ func (base *OpBase) UnmarshalJSON(data []byte) error { aux := struct { OperationType OperationType `json:"type"` - Author json.RawMessage `json:"author"` UnixTime int64 `json:"timestamp"` Metadata map[string]string `json:"metadata,omitempty"` Nonce []byte `json:"nonce"` @@ -188,14 +187,7 @@ func (base *OpBase) UnmarshalJSON(data []byte) error { return err } - // delegate the decoding of the identity - author, err := identity.UnmarshalJSON(aux.Author) - if err != nil { - return err - } - base.OperationType = aux.OperationType - base.Author_ = author base.UnixTime = aux.UnixTime base.Metadata = aux.Metadata base.Nonce = aux.Nonce |