The right against self-incrimination only applies when a person’s testimony might put them in criminal jeopardy. A person with a blanket pardon covering some period of time doesn’t face criminal jeopardy for conduct occurring during that period of time. Giuliani could therefore in theory be compelled to testify against Trump, on pain of going to jail for contempt of court if he refused.

The only escape hatch from this trap would be if Giuliani’s pardon were deemed to be invalid because it was obtained as part of a criminal act. No one knows for sure whether a criminally obtained pardon is constitutionally valid, because the issue hasn’t been litigated. But obviously, neither Trump nor Giuliani would want to go down this path.

If he really felt he had to pardon Giuliani, Trump might ostentatiously pay Giuliani lots of money first, to prove the pardon wasn’t given in exchange for forgiving the lawyer’s perhaps $20,000 per day legal fees. But it would be tough for Trump to prove that he had definitively paid for all of the work Giuliani had done.