Function: fetchVirtualAccount(address _user)
The fetchVirtualAccount
function allows any caller to associate a Virtual Account contract with a specified _user
address. If a Virtual Account for the given _user
does not already exist, the function deploys a new Virtual Account contract and updates the getUserAccount
mapping with this new contract address. If a Virtual Account already exists for the _user
, the function simply returns the existing account without making any changes.
Inputs
_user
Control: Full control by the caller.
Constraints: If a Virtual Account contract is already deployed for
_user
, the function will not deploy a new one and will return the existing account.Impact: Determines the user address for which the Virtual Account is fetched or deployed.
Branches and code coverage
No separate tests have been implemented for this function.