Compare commits

...

2 Commits

Author SHA1 Message Date
1498edbb07
Adds capability to deploy demurrage tokens. 2021-12-15 16:00:51 +03:00
10cbb1344d
Cosmetic clean ups. 2021-12-15 16:00:18 +03:00
3 changed files with 30 additions and 13 deletions

View File

@ -4,5 +4,10 @@
"precision": 0, "precision": 0,
"code": null, "code": null,
"supply": 0, "supply": 0,
"extra": {} "extra": [
{
"arg": "",
"arg_type": ""
}
]
} }

View File

@ -105,10 +105,10 @@ class Extension:
r = f.read() r = f.read()
f.close() f.close()
self.parse_code_as_hex(r) self.parse_code_as_hex(r)
except FileNotFoundError: except FileNotFoundError as e:
logg.debug('could not parse code as file: {}'.format(e)) logg.debug('could not parse code as file: {}'.format(e))
pass pass
except IsADirectoryError: except IsADirectoryError as e:
logg.debug('could not parse code as file: {}'.format(e)) logg.debug('could not parse code as file: {}'.format(e))
pass pass

View File

@ -34,7 +34,8 @@ class Token(Data):
self.supply = supply self.supply = supply
self.precision = precision self.precision = precision
self.code = code self.code = code
self.extra_args = None self.extra_args: list = []
self.extra_args_types: list = []
self.path = path self.path = path
self.token_path = os.path.join(self.path, 'token.json') self.token_path = os.path.join(self.path, 'token.json')
@ -53,8 +54,19 @@ class Token(Data):
self.precision = o['precision'] self.precision = o['precision']
self.code = o['code'] self.code = o['code']
self.supply = o['supply'] self.supply = o['supply']
self.extra_args = o['extra'] extras = []
extra_types = []
token_extras: list = o['extra']
if token_extras:
for token_extra in token_extras:
arg = token_extra.get('arg')
arg_type = token_extra.get('arg_type')
if arg:
extras.append(arg)
if arg_type:
extra_types.append(arg_type)
self.extra_args = extras
self.extra_args_types = extra_types
self.inited = True self.inited = True