I recently brought a 2001 1.8 sri astra. Took for test drive, drove fine, but orange light with car and spanner came up as heading back to dealer after a 4 mile test drive. He said he would fix that.

Went back to pick up car and light now off, drove home and everything fine. (25 mile run.

Tried to start up car with one key the following morning, wouldnt start, but other key did (the key i had driven home). Wanted both keys working so phoned dealer and he said they can be chipped/reprogrammed to work.
Took keys and car to vauxhall dealer/servicing and they tried, but said the original code you get in your car pass didnt match up, so without a code they couldnt pair it up. A 10 min job turned out to be a 1 hour job for them. They even phoned their technical department and their advice was that the car had a new ECU put in possibly key barrel too? Without knowing the code of that ECU they cant get the other key working so that the immobiliser knows the key.

So basically took back the car to the dealer and told him to sort it so both keys are working and i have the code, incase another key is needed in future incase one is lost or broken.
At present he is sorting it.

Having only brought the car2 days ago, my previous being a ford escort, Im reading up what an ECU is and does, the keys and chips and how they work with immobilsers, the fault codes the ECU gives out etc. so reading up a lot. But would just like some reassuring advice about this situation.
I understand putting in new/recycled ECUs are fine and common, but do i need the "code" of the ECU for future use or diagnostics purposes?
What "code" do i need from this ECU and can it be done?
What else should i get the dealer provide about this ECU/only one key starts the car situation?

The key that doesnt start the car, remotely and manually opens all doors, goes into ignition and turns on all lights, but doesnt turn over the engine.

Hope this is enough info and apologise if posted in wrong thread/forum area as new to this all.

Thanks for your time,