Skip to content
Snippets Groups Projects
Commit a452dfb9 authored by Moul's avatar Moul
Browse files

[mod] #396: Remove async kw from tests/patched

parent 02debefd
Branches master
No related merge requests found
...@@ -32,17 +32,17 @@ fake_block_uid = BlockUID( ...@@ -32,17 +32,17 @@ fake_block_uid = BlockUID(
) )
async def patched_params(self): def patched_params(self):
return { return {
"msValidity": 31557600, "msValidity": 31557600,
"msPeriod": 5259600, "msPeriod": 5259600,
} }
async def patched_block(self, number): def patched_block(self, number):
return mocked_block return mocked_block
## mock head_block() ## mock head_block()
async def patched_head_block(self): def patched_head_block(self):
return mocked_block return mocked_block
...@@ -40,12 +40,12 @@ from silkaj.money import amount_in_current_base ...@@ -40,12 +40,12 @@ from silkaj.money import amount_in_current_base
from silkaj.tx import MAX_INPUTS_PER_TX from silkaj.tx import MAX_INPUTS_PER_TX
async def patched_ud_value(self): def patched_ud_value(self):
return mock_ud_value return mock_ud_value
# mock get_sources() # mock get_sources()
async def patched_get_sources(pubkey): def patched_get_sources(pubkey):
""" """
Returns transaction sources. Returns transaction sources.
This function doesn't cover all possibilities : only SIG() unlock condition. This function doesn't cover all possibilities : only SIG() unlock condition.
......
...@@ -17,5 +17,5 @@ from silkaj.constants import G1_SYMBOL ...@@ -17,5 +17,5 @@ from silkaj.constants import G1_SYMBOL
# mock CurrencySymbol().symbol # mock CurrencySymbol().symbol
async def patched_currency_symbol(self): def patched_currency_symbol(self):
return G1_SYMBOL return G1_SYMBOL
...@@ -18,7 +18,7 @@ from duniterpy.key import SigningKey ...@@ -18,7 +18,7 @@ from duniterpy.key import SigningKey
from silkaj.tools import message_exit from silkaj.tools import message_exit
async def patched_gen_confirmation_table( def patched_gen_confirmation_table(
issuer_pubkey, issuer_pubkey,
pubkey_amount, pubkey_amount,
tx_amounts, tx_amounts,
...@@ -43,7 +43,7 @@ async def patched_gen_confirmation_table( ...@@ -43,7 +43,7 @@ async def patched_gen_confirmation_table(
) )
async def patched_handle_intermediaries_transactions( def patched_handle_intermediaries_transactions(
key, key,
issuers, issuers,
tx_amounts, tx_amounts,
...@@ -68,7 +68,7 @@ async def patched_handle_intermediaries_transactions( ...@@ -68,7 +68,7 @@ async def patched_handle_intermediaries_transactions(
) )
async def patched_generate_and_send_transaction( def patched_generate_and_send_transaction(
key, key,
issuers, issuers,
tx_amounts, tx_amounts,
......
...@@ -110,7 +110,7 @@ fake_sent_tx_hist = [ ...@@ -110,7 +110,7 @@ fake_sent_tx_hist = [
] ]
async def patched_get_transactions_history(client, pubkey, received_txs, sent_txs): def patched_get_transactions_history(client, pubkey, received_txs, sent_txs):
for received in fake_received_tx_hist: for received in fake_received_tx_hist:
received_txs.append(Transaction.from_bma_history(currency, received)) received_txs.append(Transaction.from_bma_history(currency, received))
for sent in fake_sent_tx_hist: for sent in fake_sent_tx_hist:
......
...@@ -27,7 +27,7 @@ pubkey_list = [ ...@@ -27,7 +27,7 @@ pubkey_list = [
# mock is_member # mock is_member
async def patched_is_member(pubkey): def patched_is_member(pubkey):
for account in pubkey_list: for account in pubkey_list:
if account["pubkey"] == pubkey: if account["pubkey"] == pubkey:
if account["uid"]: if account["uid"]:
...@@ -36,7 +36,7 @@ async def patched_is_member(pubkey): ...@@ -36,7 +36,7 @@ async def patched_is_member(pubkey):
# patch wot requirements # patch wot requirements
async def patched_wot_requirements_one_pending(pubkey, identity_uid): def patched_wot_requirements_one_pending(pubkey, identity_uid):
return { return {
"identities": [ "identities": [
{ {
...@@ -59,7 +59,7 @@ async def patched_wot_requirements_one_pending(pubkey, identity_uid): ...@@ -59,7 +59,7 @@ async def patched_wot_requirements_one_pending(pubkey, identity_uid):
} }
async def patched_wot_requirements_no_pending(pubkey, identity_uid): def patched_wot_requirements_no_pending(pubkey, identity_uid):
return { return {
"identities": [ "identities": [
{ {
...@@ -73,7 +73,7 @@ async def patched_wot_requirements_no_pending(pubkey, identity_uid): ...@@ -73,7 +73,7 @@ async def patched_wot_requirements_no_pending(pubkey, identity_uid):
# for history # for history
async def patched_identities_from_pubkeys(pubkeys, uids): def patched_identities_from_pubkeys(pubkeys, uids):
if not uids: if not uids:
return list() return list()
uniq_pubkeys = list(filter(None, set(pubkeys))) uniq_pubkeys = list(filter(None, set(pubkeys)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment