From 0c680be54486afc9b5b29c84ddd0a70981b1b538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Lewandowski?= Date: Tue, 1 Oct 2024 14:06:35 +0200 Subject: [PATCH] ARCO-205: revert changes --- internal/metamorph/store/store.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/metamorph/store/store.go b/internal/metamorph/store/store.go index daa0e1385..e123e71d8 100644 --- a/internal/metamorph/store/store.go +++ b/internal/metamorph/store/store.go @@ -89,8 +89,8 @@ type UpdateStatus struct { Error error `json:"-"` CompetingTxs []string `json:"competing_txs"` // Fields for marshalling - hashStr string - errorStr string + HashStr string `json:"hash"` + ErrorStr string `json:"error"` } // UnmarshalJSON Custom method to unmarshall the UpdateStatus struct @@ -108,12 +108,12 @@ func (u *UpdateStatus) UnmarshalJSON(data []byte) error { } // Convert the error string back to an error if necessary - if u.errorStr != "" { - u.Error = errors.New(u.errorStr) + if u.ErrorStr != "" { + u.Error = errors.New(u.ErrorStr) } // Convert the hash string back to a chainhash.Hash - hash, err := chainhash.NewHashFromStr(u.hashStr) + hash, err := chainhash.NewHashFromStr(u.HashStr) if err != nil { return err } @@ -126,10 +126,10 @@ func (u *UpdateStatus) UnmarshalJSON(data []byte) error { func (u UpdateStatus) MarshalJSON() ([]byte, error) { type Alias UpdateStatus if u.Error != nil { - u.errorStr = u.Error.Error() // Convert error to string for marshaling + u.ErrorStr = u.Error.Error() // Convert error to string for marshaling } - u.hashStr = u.Hash.String() // Convert hash to string for marshaling + u.HashStr = u.Hash.String() // Convert hash to string for marshaling return json.Marshal((*Alias)(&u)) }