God didn’t merely declare Abraham to be righteous. He actually made him righteous, and it was this actual righteousness that was fundamental to the promise God made to Isaac.
And I will multiply thy seed like the stars of heaven: and I will give to thy posterity all these countries: and in thy seed shall all the nations of the earth be blessed. Because Abraham obeyed my voice, and kept my precepts and commandments, and observed my ceremonies and laws. [Genesis 26:4-5; emphasis added]
It does not say, “Because Abraham believed in Me.” No. God makes promises to Isaac “because Abraham obeyed my voice.” What mattered was Abraham’s real holiness, and he was holy because he obeyed God. But Abraham wasn’t able to do this in his own strength, of course. God gave him grace and strength to obey. Holiness is God’s gift; it is never something that we can attain on our own. St Augustine says, “What merit, then, has man before grace which could make it possible for him to receive grace, when nothing but grace produces good merit in us; and what else but His gifts does God crown when He crowns our merits?” It was true for Abraham, and it was true for St Augustine, and it is true for us today.