```\nfunction registerEmitterAndDomain(bytes memory encodedVaa) public {\n    /* snip: parsing of Governance VAA payload */\n\n    // Set the registeredEmitters state variable.\n    registeredEmitters[foreignChain] = foreignAddress;\n\n    // update the chainId to domain (and domain to chainId) mappings\n    getChainToDomain()[foreignChain] = cctpDomain;\n    getDomainToChain()[cctpDomain] = foreignChain;\n}\n```\n