Ejemplo n.º 1
0
 def test_offline(self):
     bts = DPay(node=self.nodelist.get_nodes(),
                offline=True,
                data_refresh_time_seconds=900,
                keys={
                    "active": wif,
                    "owner": wif,
                    "memo": wif
                })
     bts.refresh_data()
     self.assertTrue(bts.get_reserve_ratio(use_stored_data=False) is None)
     self.assertTrue(bts.get_reserve_ratio(use_stored_data=True) is None)
     self.assertTrue(bts.get_feed_history(use_stored_data=False) is None)
     self.assertTrue(bts.get_feed_history(use_stored_data=True) is None)
     self.assertTrue(bts.get_reward_funds(use_stored_data=False) is None)
     self.assertTrue(bts.get_reward_funds(use_stored_data=True) is None)
     self.assertTrue(
         bts.get_current_median_history(use_stored_data=False) is None)
     self.assertTrue(
         bts.get_current_median_history(use_stored_data=True) is None)
     self.assertTrue(
         bts.get_hardfork_properties(use_stored_data=False) is None)
     self.assertTrue(
         bts.get_hardfork_properties(use_stored_data=True) is None)
     self.assertTrue(bts.get_network(use_stored_data=False) is None)
     self.assertTrue(bts.get_network(use_stored_data=True) is None)
     self.assertTrue(
         bts.get_witness_schedule(use_stored_data=False) is None)
     self.assertTrue(bts.get_witness_schedule(use_stored_data=True) is None)
     self.assertTrue(bts.get_config(use_stored_data=False) is None)
     self.assertTrue(bts.get_config(use_stored_data=True) is None)
     self.assertEqual(bts.get_block_interval(), 3)
     self.assertEqual(bts.get_blockchain_version(), '0.0.0')
Ejemplo n.º 2
0
 def test_properties(self, node_param):
     if node_param == "normal":
         bts = DPay(node=self.nodelist.get_nodes(),
                    nobroadcast=True,
                    data_refresh_time_seconds=900,
                    keys={
                        "active": wif,
                        "owner": wif,
                        "memo": wif
                    },
                    num_retries=10)
     elif node_param == "testnet":
         bts = DPay(node="https://testnet.dpaydev.com",
                    nobroadcast=True,
                    data_refresh_time_seconds=900,
                    keys={
                        "active": wif,
                        "owner": wif,
                        "memo": wif
                    },
                    num_retries=10)
     self.assertTrue(
         bts.get_reserve_ratio(use_stored_data=False) is not None)
     self.assertTrue(
         bts.get_feed_history(use_stored_data=False) is not None)
     self.assertTrue(
         bts.get_reward_funds(use_stored_data=False) is not None)
     self.assertTrue(
         bts.get_current_median_history(use_stored_data=False) is not None)
     self.assertTrue(
         bts.get_hardfork_properties(use_stored_data=False) is not None)
     self.assertTrue(bts.get_network(use_stored_data=False) is not None)
     self.assertTrue(
         bts.get_witness_schedule(use_stored_data=False) is not None)
     self.assertTrue(bts.get_config(use_stored_data=False) is not None)
     self.assertTrue(bts.get_block_interval() is not None)
     self.assertTrue(bts.get_blockchain_version() is not None)