From de1461f70f0af6508dae680dba3c56f5fe3deb44 Mon Sep 17 00:00:00 2001 From: Nate Maninger Date: Sun, 3 Nov 2024 17:40:57 -0800 Subject: [PATCH] types: fix finalization json encoding --- types/types.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/types/types.go b/types/types.go index cf1962d8..5fcd4bdc 100644 --- a/types/types.go +++ b/types/types.go @@ -555,6 +555,16 @@ func (*V2FileContractExpiration) isV2FileContractResolution() {} // revisions and immediately creating its valid outputs. type V2FileContractFinalization Signature +// MarshalText implements encoding.TextMarshaler. +func (fcf V2FileContractFinalization) MarshalText() ([]byte, error) { + return []byte(hex.EncodeToString(fcf[:])), nil +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (fcf *V2FileContractFinalization) UnmarshalText(data []byte) error { + return unmarshalHex(fcf[:], data) +} + // A V2FileContractRenewal renews a file contract. type V2FileContractRenewal struct { FinalRevision V2FileContract `json:"finalRevision"`