Gently fry the leeks, carrots and onion in the butter until softened and starting to caramelise. Add the cod and flour and stir over the heat for a minute or two. Stir in the wine and cook for another minute to allow the sauce to thicken a little. Season with salt and pepper
For the béarnaise sauce, gently heat the vinegar in a saucepan. Add the shallots, tarragon sprigs, bay leaf and peppercorns. Heat gently over a medium heat until the volume of liquid has reduced by at least half. Strain and set aside until cooled.
Meanwhile, preheat the oven to 180C/160C Fan/Gas 4 and butter a shallow ovenproof dish.
Beat the egg yolks with a teaspoon of water. Stir the mixture into the strained, cooled vinegar and pour into a heatproof bowl set over a pan of simmering water. Whisk constantly until the sauce has increased in volume and is thick enough to coat the back of a spoon.
Melt the unsalted butter in a saucepan. Remove the bowl from the heat and slowly pour in the melted butter in a steady stream, whisking continuously, until the mixture has thickened and is smooth. Fold in the chopped tarragon and season to taste with salt and pepper.
Spoon the cod and vegetable mixture into the ovenproof dish. Pour over the béarnaise sauce and bake for 15-20 minutes.