func BytesToAtx(b []byte) (*ActivationTx, error) {
	var atx ActivationTx
	err := codec.Decode(b, &atx)
	if err != nil {
		return nil, fmt.Errorf("decode: %w", err)
	}
	return &atx, nil
}
BytesToAtx deserializes an ActivationTx.
package types
import (
	"errors"
	"fmt"
	"github.com/spacemeshos/go-spacemesh/codec"
	"github.com/spacemeshos/go-spacemesh/common/util"
)
func (id BlockID) Bytes() []byte { return id.AsHash32().Bytes() }
func (l LayerID) Bytes() []byte { return util.Uint32ToBytes(l.Value) }
func BlockIdsToBytes(ids []BlockID) ([]byte, error) {
	SortBlockIDs(ids)
	buf, err := codec.Encode(&ids)
	if err != nil {
		return nil, errors.New("error marshaling block ids ")
	}
	return buf, nil
}
func BytesToBlockIds(blockIds []byte) ([]BlockID, error) {
	var ids []BlockID
	if err := codec.Decode(blockIds, &ids); err != nil {
		return nil, fmt.Errorf("error marshaling layer: %v", err)
	}
	return ids, nil
}