code: def AddContract(self, contract):
          
          if not contract.PublicKeyHash.ToBytes() in self._keys.keys():
              raise Exception('Invalid operation - public key mismatch')
  
          self._contracts[contract.ScriptHash.ToBytes()] = contract
          if contract.ScriptHash in self._watch_only:
              self._watch_only.remove(contract.ScriptHash)
docs: Add a contract to the wallet.
  
          Args:
              contract (Contract): a contract of type neo.SmartContract.Contract.
  
          Raises:
              Exception: Invalid operation - public key mismatch.