Skip to content

Commit

Permalink
Fix: opg response
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Jul 10, 2023
1 parent ecf321c commit 3394a55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cmd/api/handlers/responses.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,10 @@ type OPGResponse struct {

// NewOPGResponse -
func NewOPGResponse(opg operation.OPG) OPGResponse {
var hash string
if len(opg.Hash) > 0 {
hash = encoding.MustEncodeOperationHash(opg.Hash)
}
return OPGResponse{
LastID: opg.LastID,
ContentIndex: opg.ContentIndex,
Expand All @@ -619,7 +623,7 @@ func NewOPGResponse(opg operation.OPG) OPGResponse {
TotalCost: opg.TotalCost,
Flow: opg.Flow,
Internals: opg.Internals,
Hash: opg.Hash,
Hash: hash,
Entrypoint: opg.Entrypoint,
Timestamp: opg.Timestamp,
Status: opg.Status.String(),
Expand Down
2 changes: 1 addition & 1 deletion internal/models/operation/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type OPG struct {
TotalCost int64
Flow int64
Internals int
Hash string
Hash []byte
Entrypoint string
Timestamp time.Time
Status types.OperationStatus
Expand Down

0 comments on commit 3394a55

Please sign in to comment.