Abram believed that what Yahweh said would happen. And because of that, Yahweh considered that Abram was righteous.