Function: getEncryptionKey(uint256 _keyId)
This function verifies keyId is the most recently registered encryptionKeys inserted via registerNewEncryptionKey by the KEY_MANAGER_ROLE and returns it. It is called in the deposit flow by L1ERC20GatewayValidium::_deposit for sanity checks on the key.
Inputs
_keyIdControl: Arbitrary caller.
Constraints: Must be the last one inserted in
encryptionKeys.Impact: Return the last
encryptionKeyifkeyIdis the last one.
Branches and code coverage
Intended branches
Verifies at least one key exists.
Returns the last key value, if
keyIdrepresents the last key ID.