bitcoinlib.services.bitcoinlibtest module

class bitcoinlib.services.bitcoinlibtest.BitcoinLibTestClient(network, base_url, denominator, *args)[source]

Bases: bitcoinlib.services.baseclient.BaseClient

Dummy service client for bitcoinlib test network. Only used for testing.

Does not make any connection to a service provider, so can be used offline.

block_count()[source]
estimatefee(blocks)[source]

Dummy estimate fee method for the bitcoinlib testnet.

Parameters:blocks (int) – Number of blocks
Return int:Fee as 100000 // number of blocks
getbalance(addresslist)[source]

Dummy getbalance method for bitcoinlib testnet

Parameters:addresslist (list) – List of addresses
Return int:
getutxos(addresslist, utxos_per_address=2)[source]

Dummy method to retreive UTXO’s. This method creates a new UTXO for each address provided out of the testnet void, which can be used to create test transactions for the bitcoinlib testnet.

Parameters:
  • addresslist (list) – List of addresses
  • utxos_per_address (int) – Number of UTXO’s to be created per address
Return list:

The created UTXO set

sendrawtransaction(rawtx)[source]

Dummy method to send transactions on the bitcoinlib testnet. The bitcoinlib testnet does not exists, so it just returns the transaction hash.

Parameters:rawtx (bytes, str) – A raw transaction hash
Return str:Transaction hash