func (tp *TransactionPackage) ToProto() *pb.TransactionPackage {
	out := &pb.TransactionPackage{
		StartRoot: tp.StartRoot[:],
		EndRoot: tp.EndRoot[:],
		UpdateWitnesses: make([]*pb.UpdateWitness, len(tp.Updates)),
		VerificationWitnesses: make([]*pb.VerificationWitness, len(tp.Verifications)),
		Transactions: make([]*pb.ShardTransaction, len(tp.Transactions)),
	}

	for i := range out.UpdateWitnesses {
		out.UpdateWitnesses[i] = tp.Updates[i].ToProto()
	}

	for i := range out.VerificationWitnesses {
		out.VerificationWitnesses[i] = tp.Verifications[i].ToProto()
	}

	for i := range out.Transactions {
		out.Transactions[i] = tp.Transactions[i].ToProto()
	}

	return out
}
// ToProto converts a transaction package into the protobuf representation.
ToProto converts a transaction package into the protobuf representation.
// ToProto converts a transaction package into the protobuf representation .
func (tp *TransactionPackage) ToProto() *pb.TransactionPackage {
	out := &pb.TransactionPackage{
		StartRoot: tp.StartRoot[:],
		EndRoot: tp.EndRoot[:],
		UpdateWitnesses: make([]*pb.UpdateWitness, len(tp.Updates)),
		VerificationWitnesses: make([]*pb.VerificationWitness, len(tp.Verifications)),
		Transactions: make([]*pb.ShardTransaction, len(tp.Transactions)),
	}
	for i := range out.UpdateWitnesses {
		out.UpdateWitnesses[i] = tp.Updates[i].ToProto()
	}
	for i := range out.VerificationWitnesses {
		out.VerificationWitnesses[i] = tp.Verifications[i].ToProto()
	}
	for i := range out.Transactions {
		out.Transactions[i] = tp.Transactions[i].ToProto()
	}
	return out
}
func ( tp * TransactionPackage ) ToProto ( ) * pb . TransactionPackage { out := & pb . TransactionPackage { StartRoot : tp . StartRoot [ : ] , EndRoot : tp . EndRoot [ : ] , UpdateWitnesses : make ( [ ] * pb . UpdateWitness , len ( tp . Updates ) ) , VerificationWitnesses : make ( [ ] * pb . VerificationWitness , len ( tp . Verifications ) ) , Transactions : make ( [ ] * pb . ShardTransaction , len ( tp . Transactions ) ) , } for i := range out . UpdateWitnesses { out . UpdateWitnesses [ i ] = tp . Updates [ i ] . ToProto ( ) } for i := range out . VerificationWitnesses { out . VerificationWitnesses [ i ] = tp . Verifications [ i ] . ToProto ( ) } for i := range out . Transactions { out . Transactions [ i ] = tp . Transactions [ i ] . ToProto ( ) } return out }
ToProto converts a transaction package into the protobuf representation.
ToProto converts a transaction package into the protobuf representation .