Solved assert comparision issue and handled key error with fallback.

This commit is contained in:
ArpitShukla007 2022-04-21 07:48:41 +00:00
parent a5eb91ea60
commit 08e9a7660f
2 changed files with 4 additions and 3 deletions

View File

@ -687,8 +687,9 @@ class Transaction(object):
assets = list(planet.get_assets(tx_ids))
for asset in assets:
if asset is not None:
tx = tx_map[asset['id']]
del asset['id']
if tx_map.get(asset.get('id', None), None) is not None:
tx = tx_map[asset['id']]
del asset['id']
tx['asset'] = asset
tx_ids = list(tx_map.keys())

View File

@ -344,7 +344,7 @@ def test_election_new_upsert_validator_without_tendermint(caplog, b, priv_valida
with caplog.at_level(logging.INFO):
election_id = run_election_new_upsert_validator(args, b)
assert caplog.records[0].msg == '[SUCCESS] Submitted proposal with id: ' + election_id
assert caplog.records[0].msg == '[SUCCESS] Submitted proposal with id: ', election_id
assert b.get_transaction(election_id)