The court may restrict the taxation in the costs for witnesses to so many as may be deemed just. No entry for a witness shall be made against a party recovering costs after execution has issued for such party; and in no case shall there be an entry of a witness for attendance at a term of court after the adjournment of such term. No assignment or transfer of any costs, expenses or fees payable out of the State Treasury shall be valid unless the same be in writing, indorsed on or annexed to the voucher issued therefor, signed by the person entitled thereto and duly acknowledged before an officer authorized by law to take acknowledgments of deeds or other writings, or attested by two witnesses who shall state their respective names and post- office addresses.