Did I buy the right mountain bike? So I recently bought a 2014 Specialized hardrock 26" disc XC hardtail. 

I already taken it out on the trails. I've done research and found out that cross country bikes have less travel than all-mountain. I've already done a couple of small jumps but I'm afraid I'll mess up the bike really fast. Although my XC has double wall rims it still concerns me. 

Can someone please let me know if I bought the right bike, and if it can handle jumps around 2 feet high?
(Presumption the OP is not over about 100kg, even then, I think my answer holds) Don't worry about the bike. It can handle a lot more than you can. For years I rode with no suspension and never broke a bike. I then got, what was then a great fork - 60mm travel, and did not break the bike. I usually pulled out at more than 1 meters air on those bikes.... usually...... I got older and wiser... now I ride XC and wheels rarely leave the ground, 100mm is more than enuf. 

Some would say with two foot jumps, you have got the wrong bike. You should have got a $3000 all mountain FS. But if all you could afford was the one you have, you got the right bike. A better bike would cost more, a FS in that price  bracket would be a BSO and I would say it was the wrong bike, you shoulda got a hard tail. A HT with more travel would have lower quality components...... 

So what should you do - learn to ride lightly - land softly. Bigger travel lets people who can't ride land 2 foot jumps and look OK doing it. You won't hide poor skills behind your bike, and you will not be forgiven if (when) you screw up a landing - it will make you a better rider.  

And just reiterating  -worry more about yourself than the bike.