Skip to content

Commit

Permalink
Merge pull request #227 from SiaFoundation/nate/fix-finalization-enco…
Browse files Browse the repository at this point in the history
…ding

Hex encode finalization
  • Loading branch information
lukechampine authored Nov 4, 2024
2 parents 00682da + de1461f commit 2a3a1bf
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 2a3a1bf

Please sign in to comment.