func (s *server) GetCommitteesForSlot(ctx context.Context, in *pb.GetCommitteesForSlotRequest) (*pb.ShardCommitteesForSlot, error) {
	state := s.chain.GetState()

	sc, err := state.GetShardCommitteesAtSlot(in.Slot, s.chain.GetConfig())
	if err != nil {
		return nil, err
	}
	scProto := make([]*pb.ShardCommittee, len(sc))
	for i := range sc {
		scProto[i] = sc[i].ToProto()
	}

	return &pb.ShardCommitteesForSlot{
		Committees: scProto,
	}, nil
}
// GetCommitteesForSlot gets the current committees at a slot.
GetCommitteesForSlot gets the current committees at a slot.
// GetCommitteesForSlot gets the current committees at a slot .
func (s *server) GetCommitteesForSlot(ctx context.Context, in *pb.GetCommitteesForSlotRequest) (*pb.ShardCommitteesForSlot, error) {
	state := s.chain.GetState()
	sc, err := state.GetShardCommitteesAtSlot(in.Slot, s.chain.GetConfig())
	if err != nil {
		return nil, err
	}
	scProto := make([]*pb.ShardCommittee, len(sc))
	for i := range sc {
		scProto[i] = sc[i].ToProto()
	}
	return &pb.ShardCommitteesForSlot{
		Committees: scProto,
	}, nil
}
func ( s * server ) GetCommitteesForSlot ( ctx context . Context , in * pb . GetCommitteesForSlotRequest ) ( * pb . ShardCommitteesForSlot , error ) { state := s . chain . GetState ( ) sc , err := state . GetShardCommitteesAtSlot ( in . Slot , s . chain . GetConfig ( ) ) if err != nil { return nil , err } scProto := make ( [ ] * pb . ShardCommittee , len ( sc ) ) for i := range sc { scProto [ i ] = sc [ i ] . ToProto ( ) } return & pb . ShardCommitteesForSlot { Committees : scProto , } , nil }
GetCommitteesForSlot gets the current committees at a slot.
GetCommitteesForSlot gets the current committees at a slot .