diff --git a/.changeset/fix_account_json_encoding.md b/.changeset/fix_account_json_encoding.md new file mode 100644 index 0000000..398677e --- /dev/null +++ b/.changeset/fix_account_json_encoding.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +# Fix account JSON encoding diff --git a/rhp/v4/rhp.go b/rhp/v4/rhp.go index dc4dd10..a6db453 100644 --- a/rhp/v4/rhp.go +++ b/rhp/v4/rhp.go @@ -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 {