Whenever a petition to contest nomination or contest election of any class shall be presented to the General Assembly or to the court, it shall be the duty of said petitioners, within five days thereafter, to file a bond, signed by at least five of the said petitioners in such sum as the presiding officer of the Senate or said court shall designate, with two or more individual sureties or a corporate surety to be approved by the said officer or court or judge, conditioned for the payment of all costs which may accrue in said contested nomination or election proceeding, in case the said petitioners by decree shall be adjudged liable to pay said costs, and if the said bond shall not be filed, as herein provided, the said petition to contest the nomination or election shall be dismissed.
25 P.S. § 3459