We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents da8eea2 + c2a28d5 commit 9eb4700Copy full SHA for 9eb4700
address.go
@@ -355,6 +355,19 @@ func hash(ingest []byte, cfg *blake2b.Config) []byte {
355
return hasher.Sum(nil)
356
}
357
358
+func (a Address) MarshalBinary() ([]byte, error) {
359
+ return a.Bytes(), nil
360
+}
361
+
362
+func (a *Address) UnmarshalBinary(b []byte) error {
363
+ newAddr, err := NewFromBytes(b)
364
+ if err != nil {
365
+ return err
366
+ }
367
+ *a = newAddr
368
+ return nil
369
370
371
func (a Address) MarshalCBOR(w io.Writer) error {
372
if a == Undef {
373
return fmt.Errorf("cannot marshal undefined address")
0 commit comments