Problem: memoization for from_dict not enabled

Solution: Enable memoization decorator
This commit is contained in:
Vanshdeep Singh 2018-09-03 09:50:37 +02:00
parent c2ea25860a
commit 9280ac62a7

View File

@ -13,7 +13,6 @@ Attributes:
from collections import namedtuple from collections import namedtuple
from copy import deepcopy from copy import deepcopy
from functools import reduce, lru_cache from functools import reduce, lru_cache
import functools
import rapidjson import rapidjson
import base58 import base58
@ -29,7 +28,7 @@ from bigchaindb.common.exceptions import (KeypairMismatchException,
AmountError, AssetIdMismatch, AmountError, AssetIdMismatch,
ThresholdTooDeep) ThresholdTooDeep)
from bigchaindb.common.utils import serialize from bigchaindb.common.utils import serialize
from .memoize import memoize_from_dict, memoize_to_dict from .memoize import memoize_from_dict # , memoize_to_dict
UnspentOutput = namedtuple( UnspentOutput = namedtuple(
@ -1184,7 +1183,7 @@ class Transaction(object):
raise InvalidHash(err_msg.format(proposed_tx_id)) raise InvalidHash(err_msg.format(proposed_tx_id))
@classmethod @classmethod
# @memoize_from_dict @memoize_from_dict
def from_dict(cls, tx, skip_schema_validation=True): def from_dict(cls, tx, skip_schema_validation=True):
"""Transforms a Python dictionary to a Transaction object. """Transforms a Python dictionary to a Transaction object.