Questions & Answers about Der Postbote lachte, als ich ihm gestern versehentlich die falsche Hausnummer nannte.
The verb nennen takes two objects:
• a dative object for the person receiving the information (jemandem)
• an accusative object for the thing being named (etwas)
So ihm (to him) is dative, and die falsche Hausnummer is the accusative object.
In written or narrative German, many common verbs—including lachen and nennen—often appear in the Präteritum. In spoken German you’d more likely hear the present perfect:
Der Postbote hat gelacht, als ich ihm … genannt habe.