Genesis 30: 33 reads, “So my righteousness will answer for me in time to come, when the subject of my wages comes before you: every one that is not speckled and spotted among the goats, and brown among the lambs, will be considered stolen, if it is with me.”
I’d imagine most of us would initially want to say that Jacob’s dealing with Laban was unrighteous, since he uses a sort of trickery to fix the outcome. Jacob has no such fears though. Wisdom in warfare always works this way, as we have a bit of the ransom theory in Genesis yet again.
“Righteousness” is fidelity to the terms of the covenant, but this isn’t at all opposed to morality. Rather, the Bible gives us cause to examine all of our presuppositions of what morality ought to be. God keeps true to himself, and as he reveals himself in covenant, we keep true to his character by keeping the terms of the covenant.