func (bb *BlockBody) ToProto() *pb.BlockBody {
	atts := make([]*pb.Attestation, len(bb.Attestations))
	for i := range atts {
		atts[i] = bb.Attestations[i].ToProto()
	}
	ps := make([]*pb.ProposerSlashing, len(bb.ProposerSlashings))
	for i := range ps {
		ps[i] = bb.ProposerSlashings[i].ToProto()
	}
	cs := make([]*pb.CasperSlashing, len(bb.CasperSlashings))
	for i := range cs {
		cs[i] = bb.CasperSlashings[i].ToProto()
	}
	ds := make([]*pb.Deposit, len(bb.Deposits))
	for i := range ds {
		ds[i] = bb.Deposits[i].ToProto()
	}
	ex := make([]*pb.Exit, len(bb.Exits))
	for i := range ex {
		ex[i] = bb.Exits[i].ToProto()
	}
	vs := make([]*pb.AggregatedVote, len(bb.Votes))
	for i := range vs {
		vs[i] = bb.Votes[i].ToProto()
	}
	return &pb.BlockBody{
		Attestations:      atts,
		ProposerSlashings: ps,
		CasperSlashings:   cs,
		Deposits:          ds,
		Exits:             ex,
		Votes:             vs,
	}
}
// ToProto converts the block body to protobuf form
ToProto converts the block body to protobuf form
// ToProto converts the block body to protobuf form
func (bb *BlockBody) ToProto() *pb.BlockBody {
	atts := make([]*pb.Attestation, len(bb.Attestations))
	for i := range atts {
		atts[i] = bb.Attestations[i].ToProto()
	}
	ps := make([]*pb.ProposerSlashing, len(bb.ProposerSlashings))
	for i := range ps {
		ps[i] = bb.ProposerSlashings[i].ToProto()
	}
	cs := make([]*pb.CasperSlashing, len(bb.CasperSlashings))
	for i := range cs {
		cs[i] = bb.CasperSlashings[i].ToProto()
	}
	ds := make([]*pb.Deposit, len(bb.Deposits))
	for i := range ds {
		ds[i] = bb.Deposits[i].ToProto()
	}
	ex := make([]*pb.Exit, len(bb.Exits))
	for i := range ex {
		ex[i] = bb.Exits[i].ToProto()
	}
	vs := make([]*pb.AggregatedVote, len(bb.Votes))
	for i := range vs {
		vs[i] = bb.Votes[i].ToProto()
	}
	return &pb.BlockBody{
		Attestations:      atts,
		ProposerSlashings: ps,
		CasperSlashings:   cs,
		Deposits:          ds,
		Exits:             ex,
		Votes:             vs,
	}
}
func ( bb * BlockBody ) ToProto ( ) * pb . BlockBody { atts := make ( [ ] * pb . Attestation , len ( bb . Attestations ) ) for i := range atts { atts [ i ] = bb . Attestations [ i ] . ToProto ( ) } ps := make ( [ ] * pb . ProposerSlashing , len ( bb . ProposerSlashings ) ) for i := range ps { ps [ i ] = bb . ProposerSlashings [ i ] . ToProto ( ) } cs := make ( [ ] * pb . CasperSlashing , len ( bb . CasperSlashings ) ) for i := range cs { cs [ i ] = bb . CasperSlashings [ i ] . ToProto ( ) } ds := make ( [ ] * pb . Deposit , len ( bb . Deposits ) ) for i := range ds { ds [ i ] = bb . Deposits [ i ] . ToProto ( ) } ex := make ( [ ] * pb . Exit , len ( bb . Exits ) ) for i := range ex { ex [ i ] = bb . Exits [ i ] . ToProto ( ) } vs := make ( [ ] * pb . AggregatedVote , len ( bb . Votes ) ) for i := range vs { vs [ i ] = bb . Votes [ i ] . ToProto ( ) } return & pb . BlockBody { Attestations : atts , ProposerSlashings : ps , CasperSlashings : cs , Deposits : ds , Exits : ex , Votes : vs , } }
ToProto converts the block body to protobuf form
ToProto converts the block body to protobuf form