I find Abraham and Moses did Not live in the same time frame. ( I think the difference was about 400 years )Genesis 26:5 because Abraham obeyed My voice and kept My charge, My commandments, My statutes, and My laws.”
James 2:21 Was not Abraham our father justified by works when he offered up Isaac his son on the altar? 22You see that faith was working with his works, and as a result of the works, faith was perfected; 23and the Scripture was fulfilled which says, “AND ABRAHAM BELIEVED GOD, AND IT WAS RECKONED TO HIM AS RIGHTEOUSNESS,” and he was called the friend of God. 24You see that a man is justified by works and not by faith alone. 25In the same way, was not Rahab the harlot also justified by works when she received the messengers and sent them out by another way? 26For just as the body without the spirit is dead, so also faith without works is dead.
So, the laws at Gen. 26:5 was in connection to Genesis 17:10,23; Genesis 22:3,12 and Not the Mosaic Law.