Esempio n. 1
0
    def test_receive_amount_for_risk(self):
        #address="n3AKNG5vNXtQS4Ci7YQVQHRs5fuX3M3wor"
        address="mopxUEXSLv8Auc8AgAdHAjBwwUQeWjsGN2"
        expected_amount = 0.2

        result = float(btc_rpc_call.BTCRPCCall().amount_received_by_address(address=address,
                                                                            confirms=risk_low_confirmations))

        if result >= expected_amount:
            log.info("received with 6 confirmed")
            log.info(result)
            log.info("low")
            return

        result = float(btc_rpc_call.BTCRPCCall().amount_received_by_address(address=address,
                                                                            confirms=risk_medium_confirmations))

        if result >= expected_amount:
            log.info("received with 1 confirmed")
            log.info(result)
            log.info("medium")
            return

        result = float(btc_rpc_call.BTCRPCCall().amount_received_by_address(address=address,
                                                                            confirms=risk_high_confirmations))

        if result >= expected_amount:
            log.info("received with 0 confirmed")
            log.info(result)
            log.info("high")
            return
        else:
            log.info("received amount is not enough")
            log.info(result)
            log.info("high")
Esempio n. 2
0
    def test_balance_with_a_account(self):

        account = "mfhz9hpDawwxjpyAnLAdVq2j74mckeSrsi"
        log.info(btc_rpc_call.BTCRPCCall().get_balance(account=account))

        account = "mopxUEXSLv8Auc8AgAdHAjBwwUQeWjsGN2"
        log.info(btc_rpc_call.BTCRPCCall().get_balance(account=account))

        account = "mjuJVCKpMyuLSXvuV5SPcbunsJonqSsuxK"
        log.info(btc_rpc_call.BTCRPCCall().get_balance(account=account))
Esempio n. 3
0
    def test_list_transactions_info(self):

        log.info("test example 1:")
        address = "mopxUEXSLv8Auc8AgAdHAjBwwUQeWjsGN2"

        transactions = btc_rpc_call.BTCRPCCall().list_transactions(account=address)

        for transaction in transactions:
            if 'txid' in transaction:
                log.info(transaction['txid'])



        log.info("test example 2:")
        address = "n3AKNG5vNXtQS4Ci7YQVQHRs5fuX3M3wor"

        transactions = btc_rpc_call.BTCRPCCall().list_transactions(account=address)

        for transaction in transactions:
            if transaction['category'] is 'move':
                log.info(transaction['txid'])
 def setUp(self):
     log.info("init btc wallet")
     self.btc_rpc_call = btc_rpc_call.BTCRPCCall(wallet="send")
     self.from_account_balance = self.btc_rpc_call.get_balance(account=FROM_ACCOUNT)
 def setUp(self):
     self.btcRPCCall = btc_rpc_call.BTCRPCCall()
 def setUp(self):
     log.info("init btc wallet")
     self.btcRPCCall = btc_rpc_call.BTCRPCCall()