func (a AddressDec) Decode(r stdio.Reader) (err error) {
	*a.Addr, err = DecodeAddress(r)
	return err
}
Decode decodes a single wallet address.
package wallet
import (
	"fmt"
	stdio "io"
	"strings"
	"github.com/pkg/errors"
	"perun.network/go-perun/pkg/io"
)
type Address interface {
	io.Encoder
	Bytes() []byte
	fmt.Stringer
	Equals(Address) bool
	Cmp(Address) int
}
func IndexOfAddr(addrs []Address, addr Address) int {
	for i, a := range addrs {
		if addr.Equals(a) {
			return i
		}
	}
	return -1
}
type AddressPredicate = func(Address) bool
type Addresses []Address
type AddressesWithLen []Address
type addressSliceLen = uint16
type AddressDec struct {
	Addr *Address
}
type AddrKey string
func (a Addresses) Encode(w stdio.Writer) error {
	for i, addr := range a {
		if err := addr.Encode(w); err != nil {
			return errors.WithMessagef(err, "encoding %d-th address", i)
		}
	}
	return nil
}
func (a AddressesWithLen) Encode(w stdio.Writer) error {
	return io.Encode(w,
		addressSliceLen(len(a)),
		(Addresses)(a))
}
func (a Addresses) Decode(r stdio.Reader) (err error) {
	for i := range a {
		a[i], err = DecodeAddress(r)
		if err != nil {
			return errors.WithMessagef(err, "decoding %d-th address", i)
		}
	}
	return nil
}
func (a *AddressesWithLen) Decode(r stdio.Reader) (err error) {
	var parts addressSliceLen
	if err = io.Decode(r, &parts); err != nil {
		return errors.WithMessage(err, "decoding count")
	}
	*a = make(AddressesWithLen, parts)
	return (*Addresses)(a).Decode(r)
}