diff --git a/planetmint/transactions/common/transaction.py b/planetmint/transactions/common/transaction.py index 8ed27dd..2ce4362 100644 --- a/planetmint/transactions/common/transaction.py +++ b/planetmint/transactions/common/transaction.py @@ -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()) diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index 7c9bee6..233aa94 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -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)