Genesis 15:6
4 But look, the Lord’s message came to him: “This man will not be your heir, but instead a son who comes from your own body will be your heir.” 5 The Lord took him outside and said, “Gaze into the sky and count the stars—if you are able to count them!” Then he said to him, “So will your descendants be.” 6 Abram believed the Lord, and the Lord credited it as righteousness to him. 7 The Lord said to him, “I am the Lord who brought you out from Ur of the Chaldeans to give you this land to possess.” 8 But Abram said, “O Sovereign Lord, by what can I know that I am to possess it?”
Psalm 106:31
28 They worshiped Baal of Peor and ate sacrifices offered to the dead. 29 They made the Lord angry by their actions, and a plague broke out among them. 30 Phinehas took a stand and intervened, and the plague subsided. 31 This was credited to Phinehas as a righteous act for all generations to come. 32 They made him angry by the waters of Meribah, and Moses suffered because of them, 33 for they aroused his temper, and he spoke rashly.
Notes and References
"... The promise is met by Abraham's believing faith, and God recognizes this faith. This is stated in a sophisticated theological language typical of the period of the author who framed this scene; it is a late, theologically sophisticated interpretation. It presupposes the understanding of faith shaped by Isaiah. Isaiah made the discovery that even a king, Yahweh's anointed, might not believe a word addressed to him (Isaiah 7). Thus, the concept of belief or faith took on for him a new and important significance. In the early period, it was natural and expected that a word from God should be believed; in this period, therefore, the word 'believe' often appears with a negative. In this late promise narrative, the word 'believe' in Genesis 15:6 alludes to the author's generation, when the promises that the nation would endure began to crumble. The language and thought of a later period are even clearer in what follows: 'He accounted it to him as righteousness,' which presupposes a cultic language: the expression referred originally to a priest's recognition that a sacrifice was acceptable. Its usage was then extended to mean that someone's conduct was acceptable before God (Deuteronomy 24:13). This usage appears first in Deuteronomy. The usage in Psalm 106:31 (a late psalm) parallels Genesis 15:6 ..."
Westermann, Claus and David Green Genesis (p. 119) T&T Clark International, 2004