Skip to content

Commit

Permalink
Merge pull request #266 from SiaFoundation/nate/fix-account-json
Browse files Browse the repository at this point in the history
Fix account json
  • Loading branch information
n8maninger authored Jan 18, 2025
2 parents 239942c + 4e2d069 commit 7e64255
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fix_account_json_encoding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

# Fix account JSON encoding
4 changes: 2 additions & 2 deletions rhp/v4/rhp.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ type HostSettings struct {
type Account types.PublicKey

// String implements fmt.Stringer.
func (a Account) String() string { return fmt.Sprintf("acct:%x", a[:]) }
func (a Account) String() string { return hex.EncodeToString(a[:]) }

// MarshalText implements encoding.TextMarshaler.
func (a Account) MarshalText() []byte { return []byte(a.String()) }
func (a Account) MarshalText() ([]byte, error) { return []byte(a.String()), nil }

// UnmarshalText implements encoding.TextUnmarshaler.
func (a *Account) UnmarshalText(b []byte) error {
Expand Down

0 comments on commit 7e64255

Please sign in to comment.