From c59bda653c8e1d90a65efffe4ee837d3aeef27cc Mon Sep 17 00:00:00 2001 From: vrde Date: Wed, 28 Sep 2016 14:58:01 +0200 Subject: [PATCH] Remove extra fields from get_transaction --- bigchaindb/core.py | 5 ++++- tests/db/test_bigchain_api.py | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bigchaindb/core.py b/bigchaindb/core.py index 6a53cda6..4b5c17bc 100644 --- a/bigchaindb/core.py +++ b/bigchaindb/core.py @@ -237,7 +237,10 @@ class Bigchain(object): else: # Otherwise, check the backlog - response = self.connection.run(r.table('backlog').get(txid)) + response = self.connection.run(r.table('backlog') + .get(txid) + .without('assignee', 'assignment_timestamp') + .default(None)) if response: tx_status = self.TX_IN_BACKLOG diff --git a/tests/db/test_bigchain_api.py b/tests/db/test_bigchain_api.py index 166e4929..fa01f6b2 100644 --- a/tests/db/test_bigchain_api.py +++ b/tests/db/test_bigchain_api.py @@ -131,8 +131,7 @@ class TestBigchainApi(object): b.write_transaction(tx_signed) response, status = b.get_transaction(tx_signed["id"], include_status=True) - response.pop('assignee') - response.pop('assignment_timestamp') + # add validity information, which will be returned assert util.serialize(tx_signed) == util.serialize(response) assert status == b.TX_IN_BACKLOG