That famous promise God gave Abraham - that he and his children would possess the earth - was not given because of something Abraham did or would do. It was based on God's decision to put everything together for him, which Abraham then entered when he believed.
For the promise to Abraham or to his descendants that he would inherit the world was not through the law, but through the righteousness that comes by faith.
Romans 4:13 In-Context
And he received circumcision as a sign, a seal of the righteousness that he had by faith while he was still uncircumcised. So then, he is the father of all who believe but have not been circumcised, in order that righteousness might be credited to them.
And he is then also the father of the circumcised who not only are circumcised but who also follow in the footsteps of the faith that our father Abraham had before he was circumcised.
It was not through the law that Abraham and his offspring received the promise that he would be heir of the world, but through the righteousness that comes by faith.
For if those who depend on the law are heirs, faith means nothing and the promise is worthless,
because the law brings wrath. And where there is no law there is no transgression.