Skip to content

Commit

Permalink
types: fix finalization json encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Nov 4, 2024
1 parent 00682da commit de1461f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down

0 comments on commit de1461f

Please sign in to comment.