Example #1
0
    def test_get_ewt_usd_price_kucoin(self) -> float:
        just_test_if_mainnet_node()
        balance_service = KucoinClient()

        price = balance_service.get_ewt_usd_price()
        self.assertIsInstance(price, float)
        self.assertGreater(price, 0)
Example #2
0
    def test_get_ewt_usd_price_coingecko(self) -> float:
        just_test_if_mainnet_node()
        coingecko_client = CoingeckoClient()

        price = coingecko_client.get_ewt_usd_price()
        self.assertIsInstance(price, float)
        self.assertGreater(price, 0)
Example #3
0
    def test_get_dai_usd_price_kraken(self) -> float:
        just_test_if_mainnet_node()
        kraken_client = KrakenClient()

        # Binance is used
        price = kraken_client.get_dai_usd_price()
        self.assertIsInstance(price, float)
        self.assertGreater(price, 0)
Example #4
0
    def test_get_eth_usd_price_binance(self):
        just_test_if_mainnet_node()
        binance_client = BinanceClient()

        # Binance is used
        eth_usd_price = binance_client.get_eth_usd_price()
        self.assertIsInstance(eth_usd_price, float)
        self.assertGreater(eth_usd_price, 0)
Example #5
0
    def test_get_eth_usd_price_kraken(self):
        just_test_if_mainnet_node()
        kraken_client = KrakenClient()

        # Kraken is used
        eth_usd_price = kraken_client.get_eth_usd_price()
        self.assertIsInstance(eth_usd_price, float)
        self.assertGreater(eth_usd_price, 0)
Example #6
0
    def test_get_ewt_usd_price_kucoin(self) -> float:
        just_test_if_mainnet_node()
        kucoin_client = KucoinClient()

        price = kucoin_client.get_ewt_usd_price()
        self.assertIsInstance(price, float)
        self.assertGreater(price, 0)

        with mock.patch.object(Session, "get", side_effect=IOError("Connection Error")):
            with self.assertRaises(CannotGetPrice):
                kucoin_client.get_ewt_usd_price()
Example #7
0
    def test_get_matic_usd_price(self) -> float:
        just_test_if_mainnet_node()
        binance_client = BinanceClient()
        kraken_client = KrakenClient()
        coingecko_client = CoingeckoClient()

        price = binance_client.get_matic_usd_price()
        self.assertIsInstance(price, float)
        self.assertGreater(price, 0)

        price = kraken_client.get_matic_usd_price()
        self.assertIsInstance(price, float)
        self.assertGreater(price, 0)

        price = coingecko_client.get_matic_usd_price()
        self.assertIsInstance(price, float)
        self.assertGreater(price, 0)
Example #8
0
    def test_check_proxy_code_mainnet(self):
        mainnet_node = just_test_if_mainnet_node()
        ethereum_client = EthereumClient(mainnet_node)
        last_proxy_factory_address = "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2"
        proxy_factory = ProxyFactory(last_proxy_factory_address, ethereum_client)

        # Random Safes deployed by the proxy_factory
        safes = [
            "0x7f2722741F997c63133e656a70aE5Ae0614aD7f5",  # v1.0.0
            "0x655A9e6b044d6B62F393f9990ec3eA877e966e18",  # v1.1.1
            # '',  # v1.2.0
            "0xDaB5dc22350f9a6Aff03Cf3D9341aAD0ba42d2a6",  # v1.3.0
        ]

        for safe in safes:
            with self.subTest(safe=safe):
                self.assertTrue(proxy_factory.check_proxy_code(safe))