making adjustments so that local app works with prod db

graphs-n-shit
lza_menace 4 years ago
parent 7c169ffb46
commit 994271653c

@ -33,7 +33,7 @@ def read(id):
post = Post.get(id=id)
comments = Comment.select().where(Comment.post==post.id)
if wallet.connected:
address = wallet.addresses(account=post.account_index)[0]
address = wallet.get_address(account=post.account_index)
transfers = wallet.transfers(account=post.account_index)
else:
address = "?"

@ -72,11 +72,21 @@ class Wallet(object):
if addr_indices:
qdata['address_index'] = addr_indices
_addresses = self.make_wallet_rpc('get_address', qdata)
if 'message' in _addresses:
return None
addresses = [None] * (max(map(operator.itemgetter('address_index'), _addresses['addresses'])) + 1)
for _addr in _addresses['addresses']:
addresses[_addr['address_index']] = _addr['address']
return addresses
def get_address(self, account):
qdata = {'account_index': account}
_addresses = self.make_wallet_rpc('get_address', qdata)
if 'address' in _addresses:
return _addresses['address']
else:
return None
def new_address(self, account, label=None):
data = {'account_index': account, 'label': label}
_address = self.make_wallet_rpc('create_address', data)

Loading…
Cancel
Save