func (d Deposit) ToProto() *pb.Deposit {
	return &pb.Deposit{
		Parameters: d.Parameters.ToProto(),
	}
}
ToProto gets the protobuf representation of the deposit.
package primitives
import (
	"errors"
	"github.com/phoreproject/synapse/chainhash"
	"github.com/phoreproject/synapse/pb"
)
type DepositParameters struct {
	PubKey                [96]byte
	ProofOfPossession     [48]byte
	WithdrawalCredentials chainhash.Hash
}
func (dp *DepositParameters) Copy() DepositParameters {
	return *dp
}
func (dp *DepositParameters) ToProto() *pb.DepositParameters {
	newDp := &pb.DepositParameters{
		WithdrawalCredentials: dp.WithdrawalCredentials[:],
	}
	newDp.PublicKey = dp.PubKey[:]
	newDp.ProofOfPossession = dp.ProofOfPossession[:]
	return newDp
}
func DepositParametersFromProto(parameters *pb.DepositParameters) (*DepositParameters, error) {
	if len(parameters.PublicKey) > 96 {
		return nil, errors.New("public key should be 96 bytes")
	}
	if len(parameters.ProofOfPossession) > 48 {
		return nil, errors.New("proof of possession signature should be 48 bytes")
	}
	dp := &DepositParameters{}
	copy(dp.PubKey[:], parameters.PublicKey)
	copy(dp.ProofOfPossession[:], parameters.ProofOfPossession)
	err := dp.WithdrawalCredentials.SetBytes(parameters.WithdrawalCredentials)
	if err != nil {
		return nil, err
	}
	return dp, nil
}
type Deposit struct {
	Parameters DepositParameters
}