From 2bf70ea6a6c4c8b002fa43a78e67f8bac10bd363 Mon Sep 17 00:00:00 2001 From: Holger Date: Wed, 20 Jun 2018 18:39:36 +0200 Subject: [PATCH] Fix op.copy() for Block --- beem/block.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/beem/block.py b/beem/block.py index 7d406894..0cdedc61 100644 --- a/beem/block.py +++ b/beem/block.py @@ -190,7 +190,10 @@ def operations(self): for op in tx["operations"]: # Replace opid by op name # op[0] = getOperationNameForId(op[0]) - ops.append(op.copy()) + if isinstance(op, list): + ops.append(list(op)) + else: + ops.append(op.copy()) return ops @property @@ -224,7 +227,10 @@ def json_operations(self): for op in tx["operations"]: # Replace opid by op name # op[0] = getOperationNameForId(op[0]) - op_new = op.copy() + if isinstance(op, list): + op_new = list(op) + else: + op_new = op.copy() if 'timestamp' in op: p_date = op.get('timestamp', datetime(1970, 1, 1, 0, 0)) if isinstance(p_date, (datetime, date)):