That is why “it was credited to him as righteousness.”
just as David also speaks of the blessing on the man to whom God credits righteousness apart from works:
For what does the Scripture say? “Abraham believed God, and it was credited to him as righteousness.”
Then he believed in Adonai and He reckoned it to him as righteousness.