we should not misrepresent the scripture.
in Genesis 26:5 Abraham was not credited with righteousness for keeping the word God had spoken to him: it was declared that Abraham's seed would be blessed, and through his seed all the nations would be blessed, because of this.
Abraham believed God, and for this, God credited to Abraham as righteousness. Genesis 15:6, several chapters previous, when the very same blessing was promised to him.