Illegal to promise job in exchange for political endorsement?

It’s illegal to promise a political appointment in exchange for an endorsement. But it’s unclear how the law would be enforced regarding presidential candidates.