Rashi on 37 (25) cites the Medrash about what the camels were carrying:
and their camels were carrying, etc.: Why did Scripture publicize their burden? To let you know the reward of the righteous, for it is customary for Arabs to carry only naphtha and tar, whose odor is foul, but for this one (Joseph) it was arranged [that they should be carrying] spices, so that he should not be afflicted by a foul odor. [Mechilta Beshallach, treatise 2, section 5]
How is it that Joseph was considered a Tzaddik at this moment? Isn’t his righteousness discovered only in the later encounter with Mrs Potifar? See here where the Zohar is quoted to say,
"Rabbi Shimon says, prior to the occurrence of that test to Yosef, [he] was not called a tzaddik. Because he kept from damaging the covenant of the foundation (Yesod) he was called a tzaddik."