This is what God promised as a reward for the people's keeping the laws and commandments of Torah, including The Ten Commandments:
If you pay attention to these laws and are careful to follow them, then the Lord your God will keep his covenant of love with you, as he swore to your forefathers. He will love you and bless you and increase your numbers. He will bless the fruit of your womb, the crops of your land - your grain, new wine and oil - the calves of your herds and the lambs of your flocks in the land that he swore to your forefathers to give you. You will be blessed more than any other people; none of your men or women will be childless, nor any of your livestock without young. The Lord will keep you free from every disease. He will not inflict on you the horrible diseases you knew in Egypt, but he will inflict them on all who hate you. (Deuteronomy 7:12-15,NIV)
That's it; that's the contract which God agreed to in exchange for the Hebrews' keeping his laws (and yes, this does include The Ten Commandments). It was a very pragmatic, here-and-now agreement. The Hebrews obeyed in this life; they were rewarded in this life. The Mosaic Laws were intended to make them civilized, not perfect; God's reward reflected this. To say that any part of Torah would have made them perfect would have made no more sense to the Hebrews of that day than to say the same concerning The Code of Hammurabi.
As for their 'taking it for granted' that they would also obtain salvation through the keeping of the laws of Torah, that presupposes one thing, namely, that the Hebrews believed that there was an afterlife worthy of being obtained. Solomon, known to be one of their wisest men, told us what their attitude was toward this:
I also thought, "As for men, God tests them so that they may see that they are like the animals. Man's fate is like that of the animals; the same fate awaits them both: As one dies, so dies the other. All have the same breath; man has no advantage over the animal. Everything is meaningless. All go to the same place; all come from dust, and to dust all return. Who knows if the spirit of man rises upward and if the spirit of the animal goes down into the earth?"
So I saw that there is nothing better for a man than to enjoy his work, because that is his lot. For who can bring him to see what will happen after him? (Ecclesiastes 3:18-22,NIV)
Even today there are many Jews who describe themselves as atheistic, not because they don't believe in the existence of God, but rather because they don't believe in the existence of an afterlife. Death to them is a wall, not a doorway. Their definition of 'immortality' is for them to be remembered by those still living. That's why there is a custom of fellow Jews putting a small stone on the gravemarker of a departed Jew.
By the time of Jesus' sojourn among us there were sects within Judaism which taught that an afterlife did indeed exist. The Pharisees were one of these sects, focussing on legalism as the way of obtaining eternal life. They taught that if they pbeyed the laws of Torah to the proper degree, they could obtain salvation and oneness with God in the afterlife. But they wer using a set of laws that had nothing whatsoever to do with salvation as a means of obtaining salvation. That's called trying to put a square peg in a round hole.
Jesus stated himself that there were certain commandments that were important. We were to love God, we were to love our neighbor, we were to love one another, we were not to murder, commit adultery, give false testimony, or steal, and we were to honor our parents. But he never said that we could earn our salvation through obeying these commandments. In fact, he went so far as to say that we were to expect nothing as a reward for our own actions:
"Suppose one of you had a servant plowing or looking after the sheep. Would he say to the servant when he comes in from the field, 'Come along now and sit down to eat'? Would he not rather say, 'Prepare my supper, get yourself ready and wait on me while I eat and drink; after that you may eat and drink'? Would he thank the servant because he did what he was told to do? So you also, when you have done everything you were told to do, should say, 'We are unworthy servants; we have only done our duty.' " (The Gospel of St. Luke 17:7-10,NIV)
We are to be childlike in our faith, but not childish in our attitude toward what we do. The only reward that we are to see as our having earned as a result of our actions is the successful completion of whatever task we did. To think that our actions are earning us rewards is akin to a driver on our highways thinking that a cop should 'pull him over' in order to pay him for driving safely.
But we are not perfect, and absolute perfection is exactly what God demands of anyone who would enter his presence and survive the encounter. With him there is no such thing as 'good enough'; either our righteousness is perfect, or we are doomed. And this we are totally incapable of doing, especially since that perfection requires us to go much farther than merely obeying a set of laws and commandments. This Jesus pointed out to the rich young man in Matthew 19:16-26 (I'll let you look up that one).
So God had a decision to make. Does he 'write us off' and go on about his other business in the universe, or does he lay out the blueprints for a rescue mission that will literally save us from ourselves. Fortunately, he chose the rescue mission:
Now we know that whatever the law says, it says to those who are under the law, so that every mouth may be silenced and the whole world held accountable to God. Therefore no one will be declared righteous in his sight by observing the law; rather, through the law we become conscious of sin.
But now a righteousness from God, apart from law, has been made known, to which the Law and the Prophets testify. This righteousness from God comes through faith in Jesus Christ to all who believe. There is no difference, for all have sinned and fall short of the glory of God, and are justified freely by his grace through the redemption that came by Christ Jesus. God presented him as a sacrifice of atonement, through faith in his blood. He did this to demonstrate his justice, because in his forbearance he had left the sins committed beforehand unpunished - he did it to demonstrate his justice at the present time, so as to be just and the one who justifies those who have faith in Jesus. (Romans 3:19-26,NIV)
The righteousness that we need in order to survive in God's presence isn't our righteousness; it's his. That was the purpose of the rescue mission, namely, making it possible for us to attain as a free gift the righteousness necessary for our salvation, but which we could never obtain through our own work.
And yes, under the New Covenant, as described in Hebrews 8:1 to 10:14, we do have a code of conduct, written by a Christian for the edification of other Christians:
So I say, live by the Spirit, and you will not gratify the desires of the sinful nature. For the sinful nature desires what is contrary to the Spirit, and the Spirit what is contrary to the sinful nature. They are in conflict with each other, so that you do not do what you want. But if you are led by the Spirit, you are not under law.
The acts of the sinful nature are obvious: sexual immorality, impurity and debauchery; idolatry and witchcraft; hatred, discord, jealousy, fits of rage, selfish ambition, dissensions, factions and envy; drunkenness, orgies, and the like. I warn you, as I did before, that those who live like this will not inherit the kingdom of God.
But the fruit of the Spirit is love, joy, peace, patience, kindness, goodness, faithfulness, gentleness and self-control. Against such things there is no law. Those who belong to Christ Jesus have crucified the sinful nature with its passions and desires. Since we live by the Spirit, let us keep in step with the Spirit. Let us not become conceited, provoking and envying each other. (Galatians 5:16-26,NIV)
Instead of our code of conduct's being a list of laws and commandments, it's a list of core feelings. Since we are incapable of changing our core nature, we need the direct action of an outside force, namely, the Holy Spirit, to do it for us. He engages our sinful nature in battle in order to subdue the feelings and actions listed as 'acts of the sinful nature'; we just stay out of his way while he does it, and then follow behind him as he continues to lead us through our lives. The credit for our regeneration does not go to law, or even to ourselves. The credit goes to the Spirit's 'taking charge' and getting the job done.
But not only does he 'rein in' our sinful nature, but he also implants in us 'the fruit of the Spirit', thereby giving us a new nature that is amenable to God. Our words and actions, if they are in accordance with what God wants of us, will have these 9 'fruit' as their source of emanation. They are the borders within which we are assured that what we say and do conforms to what God would have us say and do. They are the parameters which dictate whether we are really acting 'in synch' with what God wants of us. The Old Covenant was a list of Do's and Don'ts; the New Covenant is the spiritual equivalent of a heart transplant.