Skip to content
Snippets Groups Projects
Unverified Commit 610e99d2 authored by Holger Nahrstaedt's avatar Holger Nahrstaedt Committed by GitHub
Browse files

Merge pull request #77 from crokkon/appbase_serialization

beembase/objects: fix serialization of appbase trx
parents 61c079ef 00cce53d
No related branches found
No related tags found
No related merge requests found
......@@ -51,8 +51,14 @@ class Amount(object):
a = Array([String(d[0]), d[1], d[2]])
self.str_repr = str(a.__str__())
elif isinstance(d, dict) and "nai" in d:
self.asset = None
for c in known_chains:
for asset in known_chains[c]["chain_assets"]:
if asset["asset"] == d["nai"]:
self.asset = asset["symbol"]
if not self.asset:
raise ValueError("Unknown NAI, cannot resolve symbol")
self.amount = d["amount"]
self.asset = d["nai"]
self.precision = d["precision"]
self.str_repr = json.dumps(d)
else:
......@@ -261,7 +267,14 @@ class CommentOptionExtensions(Static_variant):
"""
def __init__(self, o):
type_id, data = o
if type(o) == dict and 'type' in o and 'value' in o:
if o['type'] == "comment_payout_beneficiaries":
type_id = 0
else:
type_id = ~0
data = o['value']
else:
type_id, data = o
if type_id == 0:
data = (Beneficiaries(data))
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment