Skip to content

Commit

Permalink
[transactions] Fix Unknown op error and incorrect handling of 'extens…
Browse files Browse the repository at this point in the history
…ions'
  • Loading branch information
xeroc committed Sep 1, 2016
1 parent fcdf655 commit df78371
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions graphenebase/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ def __init__(self, op) :
self.opId = op[0]
name = self.getOperationNameForId(self.opId)
else:
self.opId = self.operations().get(op[0])
self.opId = self.operations().get(op[0], None)
name = op[0]
if not self.opId:
raise("Unknown operation")
if self.opId is None:
raise ValueError("Unknown operation")
self.name = name[0].upper() + name[1:] # klassname
try:
klass = self._getklass(self.name)
Expand Down
4 changes: 3 additions & 1 deletion graphenebase/signedtransactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ class Signed_Transaction(GrapheneObject) :
"""
def __init__(self, *args, **kwargs) :
if isArgsThisClass(self, args):
self.data = args[0].data
self.data = args[0].data
else:
if len(args) == 1 and len(kwargs) == 0:
kwargs = args[0]
if "extensions" not in kwargs:
kwargs["extensions"] = Set([])
elif not kwargs.get("extensions"):
kwargs["extensions"] = Set([])
if "signatures" not in kwargs:
kwargs["signatures"] = Array([])
else:
Expand Down

0 comments on commit df78371

Please sign in to comment.