Exemplo n.º 1
0
 def test_get_unspent_main_unused(self):
     assert len(BlockchainAPI.get_unspent(MAIN_ADDRESS_UNUSED)) == 0
Exemplo n.º 2
0
 def test_get_unspent_return_type(self):
     assert iter(BlockchainAPI.get_unspent(MAIN_ADDRESS_USED1))
Exemplo n.º 3
0
 def test_get_unspent_main_used_too_many(self):
     with pytest.raises(bit.exceptions.ExcessiveAddress):
         BlockchainAPI.get_unspent(MAIN_ADDRESS_USED3)
Exemplo n.º 4
0
 def test_get_transaction_by_id_valid(self):
     tx = BlockchainAPI.get_transaction_by_id(MAIN_TX_VALID)
     assert calc_txid(tx) == MAIN_TX_VALID
Exemplo n.º 5
0
 def test_get_transaction_by_id_invalid(self):
     assert BlockchainAPI.get_transaction_by_id(TX_INVALID) == None
Exemplo n.º 6
0
 def test_get_transactions_unused(self):
     assert len(BlockchainAPI.get_transactions(MAIN_ADDRESS_UNUSED)) == 0
Exemplo n.º 7
0
 def test_get_transactions_used(self):
     assert len(BlockchainAPI.get_transactions(MAIN_ADDRESS_USED1)) >= 236
Exemplo n.º 8
0
 def test_get_transactions_return_type(self):
     assert iter(BlockchainAPI.get_transactions(MAIN_ADDRESS_USED1))
Exemplo n.º 9
0
 def test_get_balance_unused(self):
     assert BlockchainAPI.get_balance(MAIN_ADDRESS_UNUSED) == 0
Exemplo n.º 10
0
 def test_get_balance_return_type(self):
     assert isinstance(BlockchainAPI.get_balance(MAIN_ADDRESS_USED1), int)