Changes essential to pass tests

Signed-off-by: Amartya Gaur amarkaushik1999@gmail.com
This commit is contained in:
amartya-dev 2020-05-18 08:54:39 +05:30
parent 30aed497d3
commit d3bf7b92e4
No known key found for this signature in database
GPG Key ID: 8AA4B93AE39AA14D
3 changed files with 11 additions and 10 deletions

View File

@ -546,7 +546,7 @@ class Transaction(object):
elif (operation == self.TRANSFER and elif (operation == self.TRANSFER and
not (isinstance(asset, dict) and 'id' in asset)): not (isinstance(asset, dict) and 'id' in asset)):
raise TypeError(('`asset` must be a dict holding an `id` property ' raise TypeError(('`asset` must be a dict holding an `id` property '
"for 'TRANSFER' Transactions")) "for \'TRANSFER\' Transactions"))
if outputs and not isinstance(outputs, list): if outputs and not isinstance(outputs, list):
raise TypeError('`outputs` must be a list instance or None') raise TypeError('`outputs` must be a list instance or None')
@ -869,7 +869,8 @@ class Transaction(object):
return cls._sign_threshold_signature_fulfillment(input_, message, return cls._sign_threshold_signature_fulfillment(input_, message,
key_pairs) key_pairs)
else: else:
raise ValueError("Fulfillment couldn't be matched to " raise ValueError(
'Fulfillment couldn\'t be matched to '
'Cryptocondition fulfillment type.') 'Cryptocondition fulfillment type.')
@classmethod @classmethod

View File

@ -46,9 +46,9 @@ class App(BaseApplication):
self.chain = self.bigchaindb.get_latest_abci_chain() self.chain = self.bigchaindb.get_latest_abci_chain()
def log_abci_migration_error(self, chain_id, validators): def log_abci_migration_error(self, chain_id, validators):
logger.error(f'An ABCI chain migration is in process. ' + logger.error('An ABCI chain migration is in process. '
'Download the new ABCI client and configure it with ' + 'Download the new ABCI client and configure it with '
'chain_id={chain_id} and validators={validators}.') f'chain_id={chain_id} and validators={validators}.')
def abort_if_abci_chain_is_not_synced(self): def abort_if_abci_chain_is_not_synced(self):
if self.chain is None or self.chain['is_synced']: if self.chain is None or self.chain['is_synced']:
@ -69,8 +69,8 @@ class App(BaseApplication):
chain_id = known_chain['chain_id'] chain_id = known_chain['chain_id']
if known_chain['is_synced']: if known_chain['is_synced']:
msg = f'Got invalid InitChain ABCI request ({genesis}) - ' + \ msg = (f'Got invalid InitChain ABCI request ({genesis}) - '
'the chain {chain_id} is already synced.' f'the chain {chain_id} is already synced.')
logger.error(msg) logger.error(msg)
sys.exit(1) sys.exit(1)

View File

@ -271,8 +271,8 @@ def test_get_spending_transactions_multiple_inputs():
({'transaction_id': tx3.id, 'output_index': 0}, 1, [tx4.id]), ({'transaction_id': tx3.id, 'output_index': 0}, 1, [tx4.id]),
({'transaction_id': tx3.id, 'output_index': 1}, 0, None), ({'transaction_id': tx3.id, 'output_index': 1}, 0, None),
] ]
for l, num, match in links: for li, num, match in links:
txns = list(query.get_spending_transactions(conn, [l])) txns = list(query.get_spending_transactions(conn, [li]))
assert len(txns) == num assert len(txns) == num
if len(txns): if len(txns):
assert [tx['id'] for tx in txns] == match assert [tx['id'] for tx in txns] == match