def setUpClass(cls) -> None:
     cls.ethereum_node_url = cls.ETHEREUM_NODE_URL
     cls.ethereum_client = EthereumClient(cls.ethereum_node_url)
     cls.w3 = cls.ethereum_client.w3
     cls.ethereum_test_account = Account.from_key(cls.ETHEREUM_ACCOUNT_KEY)
     cls.safe_contract_address = Safe.deploy_master_contract(cls.ethereum_client,
                                                             cls.ethereum_test_account).contract_address
     cls.safe_old_contract_address = Safe.deploy_master_contract_v1_0_0(cls.ethereum_client,
                                                                        cls.ethereum_test_account).contract_address
     cls.proxy_factory = ProxyFactory(
         ProxyFactory.deploy_proxy_factory_contract(cls.ethereum_client,
                                                    cls.ethereum_test_account).contract_address,
         cls.ethereum_client)
Example #2
0
    def test_check_proxy_code(self):
        proxy_contract_address = self.deploy_test_safe().safe_address
        self.assertTrue(
            self.proxy_factory.check_proxy_code(proxy_contract_address))

        ethereum_tx_sent = Safe.deploy_master_contract(
            self.ethereum_client, self.ethereum_test_account)
        self.assertFalse(
            self.proxy_factory.check_proxy_code(
                ethereum_tx_sent.contract_address))

        ethereum_tx_sent = self.proxy_factory.deploy_proxy_contract(
            self.ethereum_test_account,
            Account.create().address)
        self.assertTrue(
            self.proxy_factory.check_proxy_code(
                ethereum_tx_sent.contract_address))