(a) Any proceeding constituting a part of a criminal action based upon the charge or charges which were pending against the defendant at the time of the witness's testimony and to which such testimony related; and
(b) Any post-judgment proceeding in which a judgment of conviction upon a charge specified in paragraph (a) is challenged.