Skip to content

Commit

Permalink
finish to migrate composer.py tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouziel committed Jan 27, 2025
1 parent e4f830c commit 045004c
Show file tree
Hide file tree
Showing 2 changed files with 1,515 additions and 19 deletions.
6 changes: 4 additions & 2 deletions counterparty-core/counterpartycore/pytest/mocks/bitcoind.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def list_unspent(self, source, allow_unconfirmed_inputs=True):
{
"txid": txid,
"vout": 0,
"amount": int(10 * config.UNIT),
"amount": 10,
"value": int(10 * config.UNIT),
"script_pub_key": script_pub_key,
}
Expand Down Expand Up @@ -122,7 +122,7 @@ def get_utxo_address_and_value(utxo):
return BlockchainMock().get_utxo_address_and_value(utxo)


def satoshis_per_vbyte():
def satoshis_per_vbyte(confirmation_target=None):

Check warning

Code scanning / pylint

Unused argument 'confirmation_target'. Warning

Unused argument 'confirmation_target'.
return 2


Expand Down Expand Up @@ -182,12 +182,14 @@ def bitcoind_mock(monkeymodule):
monkeymodule.setattr(f"{bitcoind_module}.list_unspent", list_unspent)
monkeymodule.setattr(f"{bitcoind_module}.satoshis_per_vbyte", satoshis_per_vbyte)
monkeymodule.setattr(f"{bitcoind_module}.get_vin_info", get_vin_info)
monkeymodule.setattr(f"{bitcoind_module}.convert_to_psbt", lambda x: x)
monkeymodule.setattr(
f"{bitcoind_module}.get_utxo_address_and_value", get_utxo_address_and_value
)
monkeymodule.setattr(f"{gettxinfo_module}.is_valid_der", is_valid_der)
monkeymodule.setattr(f"{backend_module}.search_pubkey", search_pubkey)
monkeymodule.setattr("counterpartycore.lib.messages.bet.date_passed", lambda x: False)

return sys.modules[__name__]


Expand Down
Loading

0 comments on commit 045004c

Please sign in to comment.