Example #1
0
 def test_has_funds_for_transaction_returns_true_if_funds_exist(
         self, mock_get):
     level_5_actions._interchain_client.get_transaction_fee_estimate = MagicMock(
         return_value=5000)
     self.assertTrue(level_5_actions.has_funds_for_transactions())
     mock_get.assert_called_once()
     level_5_actions._interchain_client.get_transaction_fee_estimate.assert_called_once(
     )
Example #2
0
    def test_has_funds_for_transaction_does_not_call_matchmaking_when_not_needed(self, mock_get, mock_fund):
        level_5_actions.FUNDED = False
        level_5_actions._interchain_client.get_transaction_fee_estimate = MagicMock(return_value=5000)

        self.assertFalse(level_5_actions.has_funds_for_transactions())
        level_5_actions._interchain_client.get_transaction_fee_estimate.assert_called_once()
        mock_fund.assert_not_called()
        self.assertFalse(level_5_actions.FUNDED)
        mock_get.assert_called_once()
Example #3
0
    def test_has_funds_for_transaction_returns_false_if_funds_dont_exist(self, mock_get, mock_fund):
        level_5_actions.FUNDED = True
        level_5_actions._interchain_client.get_transaction_fee_estimate = MagicMock(return_value=5000)

        self.assertFalse(level_5_actions.has_funds_for_transactions())
        level_5_actions._interchain_client.get_transaction_fee_estimate.assert_called_once()
        mock_fund.assert_called_once_with(False)
        self.assertFalse(level_5_actions.FUNDED)
        mock_get.assert_called_once()
Example #4
0
 def test_has_funds_for_transaction_returns_false_for_new_chain(self, mock_get):
     self.assertFalse(level_5_actions.has_funds_for_transactions())
     mock_get.assert_called_once()