Skip to content

Commit

Permalink
Fix op.copy() for Block
Browse files Browse the repository at this point in the history
  • Loading branch information
holgern committed Jun 20, 2018
1 parent 53c857e commit 2bf70ea
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions beem/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)):
Expand Down

0 comments on commit 2bf70ea

Please sign in to comment.